Hi,
I'm using vs2005 Beta 2
Window Mobile 5.0 PocketPC Emulator SDK
I have a C++ dll project that export some functions.
This is a sample function :
#define AMSYNCDB_API __declspec(dllexport)
extern "C"
{
AMSYNCDB_API HRESULT __stdcall GetVer();
} // extern "C"
HRESULT GetVer()
{
return 0;
}
When I use LoadLibrary from a C++ project using this code :
HMODULE hm = LoadLibrary(TEXT("\\SmartDeviceDLL\\SmartDeviceDLL.dll"));
It works fine.
If I use LoadLibrary from csharp using this code :
[DllImport("CoreDll.dll", EntryPoint = "LoadLibrary", SetLastError=true)]
private static extern int LoadLibrary(string lpFileName);
int iHndle = LoadLibrary("\\SmartDeviceDLL\\SmartDeviceDLL.dll");
int iLastErr = Marshal.GetLastWin32Error();
I get iHndle = 0
and iLastErr = 126
error description :
"The specified module could not be found. "
I used the same code with evc4 and vs 2003 and it worked fine.
Please,
Can someone help me.
Wei-Dong XU [MSFT] - 14 Nov 2005 06:24 GMT
Hi,
Currently I am finding one support professional for you on this issue. If
any update, we will reply at the first time.
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance.
"Peter Huang" [MSFT] - 15 Nov 2005 08:12 GMT
Hi
I think you may try to use the Full Path to the DLL to see if that works.
Or try to check what is the current directory.
HOW TO: Determine the Executing Application's Path
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncfhowto/h
tml/HOWTOExecutingAppPath.asp
Also for compact framework issue, please post in the newsgroup below. This
newsgroup is mainly for desktop framework dev issue.
microsoft.public.dotnet.framework.compactframework
microsoft.public.pocketpc.developer
BTW: beta produce is not supported, because it may have problems which are
fixed in officially released product.
Best regards,
Peter Huang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.