PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Cant find Pinvoke DLL

Reply

Cant find Pinvoke DLL

 
Thread Tools Rate Thread
Old 21-06-2007, 10:24 PM   #1
=?Utf-8?B?TmFyZXNoIE1pcmtoZWxrYXI=?=
Guest
 
Posts: n/a
Default Cant find Pinvoke DLL


Hi,

I have an an existing VC++ code for Windows Mobile 5.0 and we are able to
call this dll properly over Windows Mobile 5.0 device using
[DllImport("sample.dll")].
I had to use the same functionality of this dll in PocketPC 2003. I have
changed the Target platform to Pocket PC 2003 using Configuration manager in
VS2005. Initially I ended with linker errors which i was able to resolve by
one of the suggestions from MSDN asking me to add "ccrtrtti.lib" library
after which I did not get any compiler or Linker errors.
However, when I try to access any of the methods, I am ending up with "Can't
find PInvoke dll" error.

I used dumpbin to check if methods are really exported using Dumpbin
/exports and I can see all the methods I want to use as exported.

I have ensured that the dll is placed in \Windows folder.

I have configured loader in registry and could see the below message

"Failed to find/load [sample.dll] (even in [\Windows\])"

I have run out of options and need some hints on where to start
troubleshooting.

Thanks,
Naresh
  Reply With Quote
Old 22-06-2007, 07:09 PM   #2
=?Utf-8?B?ZGJncmljaw==?=
Guest
 
Posts: n/a
Default RE: Cant find Pinvoke DLL

Try writing a test app using VC++. Just do a loadlibrary call and verify
that the call returns a valid handle. If not then call GetLastError. This
should give you an indication why the dll is not loading in 2003.

Rick D.
Contractor

"Naresh Mirkhelkar" wrote:

> Hi,
>
> I have an an existing VC++ code for Windows Mobile 5.0 and we are able to
> call this dll properly over Windows Mobile 5.0 device using
> [DllImport("sample.dll")].
> I had to use the same functionality of this dll in PocketPC 2003. I have
> changed the Target platform to Pocket PC 2003 using Configuration manager in
> VS2005. Initially I ended with linker errors which i was able to resolve by
> one of the suggestions from MSDN asking me to add "ccrtrtti.lib" library
> after which I did not get any compiler or Linker errors.
> However, when I try to access any of the methods, I am ending up with "Can't
> find PInvoke dll" error.
>
> I used dumpbin to check if methods are really exported using Dumpbin
> /exports and I can see all the methods I want to use as exported.
>
> I have ensured that the dll is placed in \Windows folder.
>
> I have configured loader in registry and could see the below message
>
> "Failed to find/load [sample.dll] (even in [\Windows\])"
>
> I have run out of options and need some hints on where to start
> troubleshooting.
>
> Thanks,
> Naresh

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off