Hello Friends,
I m new to window programming in .net 2.0.
Suppose i have a code line mentioning following...
[DllImport("example.dll", EntryPoint = "?GetINBOXFileDetails@@YAHHPAD@Z")]
My question is where to find this exapmle.dll file in a project.
Thanks,
Loading
AlanPosted Feb 27, 2008, 2:10 PM
The problem is probably that example.dll cannot be found because it's not stored in the current directory or in the search path given in the PATH environment variable.
I'd either copy the dll to the same directory as where your .exe resides or use the full path to the dll in the DllImport attribute rather than just the file name.
SatishPosted Feb 27, 2008, 6:45 AM
**************************************************
System.DllNotFoundException: Unable to load DLL 'example.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
*********************************************
what can be the problem?
I can understand my module can not load example.dll. I have the file example.dll stored on my pc.
can i add it again usind add references?
AlanPosted Feb 20, 2008, 4:12 AM
There's a great free utility called, Dependency Walker (depends.exe), which allows you to examine the exported functions in a dll and to see which other dlls it depends on.
This utility comes with Visual Studio but, if you can't find it, you can download a copy from here:
http://www.dependencywalker.com/
SatishPosted Feb 20, 2008, 12:05 AM
Well, is there any other way to see its content?
AlanPosted Feb 19, 2008, 7:11 AM
The DllImport attribute is only used when you are calling a function in an unmanaged dll.
So, 'example.dll' is an unmanaged dll and (unless it has been linked in as a resource) will not be included in your project's files. At runtime, the CLR will search for this dll in the usual way and, if it finds it, look in its export table for the appropriate entrypoint and then call the corresponding function.