C++ .dll to C# for Pocket PC


J

james.nelson.ii

I have a .dll program I created in VS2005 C++ that is referencing
an .lib file from an API. My main code is in C#, for Windows Mobile
5.0 Pocket PC. The C# program uses the following lines of code to
PInvoke the .dll:

[DllImport("Sample.dll", EntryPoint="StartHere")]
public static extern bool StartHere();

The .dll uses a .def file, which is simply:

LIBRARY "Sample"

EXPORTS
StartHere @1

Right now, I'm getting a "Can't find PInvoke DLL 'Sample.dll'." error
message during runtime. I'm trying to test directly on a Pocket PC
device from VS2005.

Those are pretty much all of the specifics I can think of at this
moment. Any suggestions?
 
Ad

Advertisements

P

Peter Foot [MVP]

And this native dll is definitely created as a Smart Device C++ project and
compiled for the ARM processor?

Peter
 
G

Guest

1. Use dumpbin to verify that the function really is is exported and not
decorated from the DLL.
2. Make sure the DLL is in the \Windows folder
3. Make sure the DLL is compiled for the right processor and OS version
 
Ad

Advertisements

J

james.nelson.ii

Thanks! The file transfer seemed to be my major slip up- everything
else seems to function now.

-james

1. Use dumpbin to verify that the function really is is exported and not
decorated from the DLL.
2. Make sure the DLL is in the \Windows folder
3. Make sure the DLL is compiled for the right processor and OS version

--
Chris Tacke - Embedded MVP
OpenNETCF Consulting
Managed Code in the Embedded Worldwww.opennetcf.com
--


I have a .dll program I created in VS2005 C++ that is referencing
an .lib file from an API. My main code is in C#, for Windows Mobile
5.0 Pocket PC. The C# program uses the following lines of code to
PInvoke the .dll:
[DllImport("Sample.dll", EntryPoint="StartHere")]
public static extern bool StartHere();
The .dll uses a .def file, which is simply:
LIBRARY "Sample"
EXPORTS
StartHere @1
Right now, I'm getting a "Can't find PInvoke DLL 'Sample.dll'." error
message during runtime. I'm trying to test directly on a Pocket PC
device from VS2005.
Those are pretty much all of the specifics I can think of at this
moment. Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top