473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Unable to load DLL - The file is there

I have a problem loading a DLL file that is exactly in the same
directory of the executable. The DLL is not in .NET format but can be
accessed through P/Invoke.

This never happened to me.

My Platform Invoke looks something like this:

[ DllImport("WRAPI.dll", EntryPoint="WRAPIEnumerateDevices") ]
static extern int _EnumerateDevices(out IntPtr ppDeviceList, out int
plItems);

....
_EnumerateDevices(...)
....

Mar 13 '06 #1
7 2623
What about it's dependencies, are they also there or in the path? What tool
was used to build the DLL and which version?

Willy.

"Nuno Magalhaes" <nu************@hotmail.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
|I have a problem loading a DLL file that is exactly in the same
| directory of the executable. The DLL is not in .NET format but can be
| accessed through P/Invoke.
|
| This never happened to me.
|
| My Platform Invoke looks something like this:
|
| [ DllImport("WRAPI.dll", EntryPoint="WRAPIEnumerateDevices") ]
| static extern int _EnumerateDevices(out IntPtr ppDeviceList, out int
| plItems);
|
| ...
| _EnumerateDevices(...)
| ...
|
Mar 13 '06 #2
I used MS Visual Studio .NET 2003 and the source code compiled OK. The
code is based upon multiple DeviceIoControl calls and doesn't seem to
exist nothing excentric.

What DLL should I be missing? Note that I didn't install the Windows
DDK, I just found an header that allows the DLL to work in Windows XP
SP1 or later.

Dependency Walker says that MSJAVA.DLL is missing, but even with
MSJAVA.DLL in system32 folder says that "At least one module has an
unresolved import due to a missing export function in a delay-load
dependent module". And I guess the problem is with the MPR.DLL.

Any ideas?

Willy Denoyette [MVP] wrote:
What about it's dependencies, are they also there or in the path? What tool
was used to build the DLL and which version?

Willy.

"Nuno Magalhaes" <nu************@hotmail.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
|I have a problem loading a DLL file that is exactly in the same
| directory of the executable. The DLL is not in .NET format but can be
| accessed through P/Invoke.
|
| This never happened to me.
|
| My Platform Invoke looks something like this:
|
| [ DllImport("WRAPI.dll", EntryPoint="WRAPIEnumerateDevices") ]
| static extern int _EnumerateDevices(out IntPtr ppDeviceList, out int
| plItems);
|
| ...
| _EnumerateDevices(...)
| ...
|


Mar 13 '06 #3
Can you download the WRAPI.dll from:
http://sysnet.ucsd.edu/pawn/wrapi/download.html

....and do a DLLImport like this...:
-----------------------------------
[ DllImport("WRAPI.dll", EntryPoint="WRAPIOpenNdisDevice") ]
static extern int _OpenNdisDevice([MarshalAs(UnmanagedType.LPWStr)]
String pwDeviceName);
public static bool OpenNdisDevice(String deviceName)
{
return (_OpenNdisDevice(deviceName) == 0);
}
-----------------------------------

....and tell me what are the DLL's missing in your computer?
Although I'm not using that version. I built using the MFC 7.1
dependencies and not the 4.2d.

Mar 13 '06 #4
If it compiles in C++ it should load correctly in C# wouldn't it be?

Mar 13 '06 #5
This program opens the \\\\.\\\\Ndisuio device, do you have the device
driver installed?

Willy.
"Nuno Magalhaes" <nu************@hotmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...

|I used MS Visual Studio .NET 2003 and the source code compiled OK. The
| code is based upon multiple DeviceIoControl calls and doesn't seem to
| exist nothing excentric.
|
| What DLL should I be missing? Note that I didn't install the Windows
| DDK, I just found an header that allows the DLL to work in Windows XP
| SP1 or later.
|
| Dependency Walker says that MSJAVA.DLL is missing, but even with
| MSJAVA.DLL in system32 folder says that "At least one module has an
| unresolved import due to a missing export function in a delay-load
| dependent module". And I guess the problem is with the MPR.DLL.
|
| Any ideas?
|
| Willy Denoyette [MVP] wrote:
| > What about it's dependencies, are they also there or in the path? What
tool
| > was used to build the DLL and which version?
| >
| > Willy.
| >
| > "Nuno Magalhaes" <nu************@hotmail.com> wrote in message
| > news:11**********************@p10g2000cwp.googlegr oups.com...
| > |I have a problem loading a DLL file that is exactly in the same
| > | directory of the executable. The DLL is not in .NET format but can be
| > | accessed through P/Invoke.
| > |
| > | This never happened to me.
| > |
| > | My Platform Invoke looks something like this:
| > |
| > | [ DllImport("WRAPI.dll", EntryPoint="WRAPIEnumerateDevices") ]
| > | static extern int _EnumerateDevices(out IntPtr ppDeviceList, out int
| > | plItems);
| > |
| > | ...
| > | _EnumerateDevices(...)
| > | ...
| > |
|
Mar 13 '06 #6
Yes, I think I have. Tried with an wireless USB adapter and a wireless
linksys card and the error is the same, even with the WrapiTest.cpp.

Iniside the DLL, even before it begins main() of WrapiTest.cpp, it
gives the error "IOCTL_NDISUIO_BIND_WAIT failed 32". The error 32 is in
hexadecimal... it's 50 and corresponds to the GetLastError that is
ERROR_NOT_SUPPORTED.

Any ideas, again?

Willy Denoyette [MVP] wrote:
This program opens the \\\\.\\\\Ndisuio device, do you have the device
driver installed?

Willy.
"Nuno Magalhaes" <nu************@hotmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...

|I used MS Visual Studio .NET 2003 and the source code compiled OK. The
| code is based upon multiple DeviceIoControl calls and doesn't seem to
| exist nothing excentric.
|
| What DLL should I be missing? Note that I didn't install the Windows
| DDK, I just found an header that allows the DLL to work in Windows XP
| SP1 or later.
|
| Dependency Walker says that MSJAVA.DLL is missing, but even with
| MSJAVA.DLL in system32 folder says that "At least one module has an
| unresolved import due to a missing export function in a delay-load
| dependent module". And I guess the problem is with the MPR.DLL.
|
| Any ideas?
|
| Willy Denoyette [MVP] wrote:
| > What about it's dependencies, are they also there or in the path? What
tool
| > was used to build the DLL and which version?
| >
| > Willy.
| >
| > "Nuno Magalhaes" <nu************@hotmail.com> wrote in message
| > news:11**********************@p10g2000cwp.googlegr oups.com...
| > |I have a problem loading a DLL file that is exactly in the same
| > | directory of the executable. The DLL is not in .NET format but can be
| > | accessed through P/Invoke.
| > |
| > | This never happened to me.
| > |
| > | My Platform Invoke looks something like this:
| > |
| > | [ DllImport("WRAPI.dll", EntryPoint="WRAPIEnumerateDevices") ]
| > | static extern int _EnumerateDevices(out IntPtr ppDeviceList, out int
| > | plItems);
| > |
| > | ...
| > | _EnumerateDevices(...)
| > | ...
| > |
|


Mar 14 '06 #7
This error is returned from the DeviceIoControl call in InitInstance, what
makes me think you don't have the right device driver installed or this code
was written for another device.
Willy.
"Nuno Magalhaes" <nu************@hotmail.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
| Yes, I think I have. Tried with an wireless USB adapter and a wireless
| linksys card and the error is the same, even with the WrapiTest.cpp.
|
| Iniside the DLL, even before it begins main() of WrapiTest.cpp, it
| gives the error "IOCTL_NDISUIO_BIND_WAIT failed 32". The error 32 is in
| hexadecimal... it's 50 and corresponds to the GetLastError that is
| ERROR_NOT_SUPPORTED.
|
| Any ideas, again?
|
| Willy Denoyette [MVP] wrote:
| > This program opens the \\\\.\\\\Ndisuio device, do you have the device
| > driver installed?
| >
| > Willy.
| > "Nuno Magalhaes" <nu************@hotmail.com> wrote in message
| > news:11**********************@v46g2000cwv.googlegr oups.com...
| >
| > |I used MS Visual Studio .NET 2003 and the source code compiled OK. The
| > | code is based upon multiple DeviceIoControl calls and doesn't seem to
| > | exist nothing excentric.
| > |
| > | What DLL should I be missing? Note that I didn't install the Windows
| > | DDK, I just found an header that allows the DLL to work in Windows XP
| > | SP1 or later.
| > |
| > | Dependency Walker says that MSJAVA.DLL is missing, but even with
| > | MSJAVA.DLL in system32 folder says that "At least one module has an
| > | unresolved import due to a missing export function in a delay-load
| > | dependent module". And I guess the problem is with the MPR.DLL.
| > |
| > | Any ideas?
| > |
| > | Willy Denoyette [MVP] wrote:
| > | > What about it's dependencies, are they also there or in the path?
What
| > tool
| > | > was used to build the DLL and which version?
| > | >
| > | > Willy.
| > | >
| > | > "Nuno Magalhaes" <nu************@hotmail.com> wrote in message
| > | > news:11**********************@p10g2000cwp.googlegr oups.com...
| > | > |I have a problem loading a DLL file that is exactly in the same
| > | > | directory of the executable. The DLL is not in .NET format but can
be
| > | > | accessed through P/Invoke.
| > | > |
| > | > | This never happened to me.
| > | > |
| > | > | My Platform Invoke looks something like this:
| > | > |
| > | > | [ DllImport("WRAPI.dll", EntryPoint="WRAPIEnumerateDevices") ]
| > | > | static extern int _EnumerateDevices(out IntPtr ppDeviceList, out
int
| > | > | plItems);
| > | > |
| > | > | ...
| > | > | _EnumerateDevices(...)
| > | > | ...
| > | > |
| > |
|
Mar 15 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Nancy | last post by:
Hi, When I start my PC(winXP Pro), it always says: Unknown(): Unable toload dynamic library './php_msql.dll' - The specified module could not be found. Then my Apache servre starts, load php...
8
by: Jonathan Polley | last post by:
I have one account on a WindowsXP machine that refuses to run IDLE (or any other python script that uses Tk). Other people can login to that PC and IDLE runs just fine, so it is not an...
2
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
7
by: ccp999 | last post by:
I keep getting this: "PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_mysql.dll' - The specified module could not be found." when I tried to load the php_mysql.dll...
0
by: Steve Richter | last post by:
I am trying, really trying to use the DB2Connection class provided by IBM to connect to a database on my old reliable as400 from the asp.net web page. When I run the DB2Connection code in my...
22
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to...
1
by: Dan | last post by:
Environment: Win2k Server, ASP.NET(v1.1.4322) Everything seemed to work fine till this morning...and than this happened What could this possibly mean? Is it the file? (The file in the error...
0
by: wildman | last post by:
Trying to read XML files from SSIS and load into SQL Server. I tested this before and it was working before I placed in a forevery contrainer. also, my simple xml file had to be retyped cause I...
3
by: =?Utf-8?B?TGV3aXMgTW90ZW4=?= | last post by:
Hello. We are having a problem here trying to compile C# applications. Only one developer has a problem where they attempt to compile the application and the compiler complains about being out of...
9
by: Christopher Koeber | last post by:
Hello, I am attempting to perform a PHP installation on an Apache 2.2.6 web server instance that is loaded on a Windows 2003 server operating system (R2 SP2). I have a third party application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.