DllImport fails every time....

S

Safiiru no Baka

The code will explain better than I can:

THE DDL:
===============================================
extern "C" __declspec(dllexport) int Scratch()
{
return 13;
}
===============================================

THE APP:
===============================================
[DllImport("mydll.dll", SetLastError=true)]
private static extern int Scratch();
===============================================

The DLL has been compiled using eVC 4.0 and I included it in the
project using "Add Existing Item". I'm testing this on emulator
version 4.1.0. The DLL properly shows itself in the same folder as the
EXE. I'm getting MissingMethodException and I'm stumped... please
help.
 
S

s_alexander04

What if to write full path to dll in DllImport directive?

For example, when I do
StreamWriter sw=new StreamWriter("file.txt"));
it ctreates file in root directory of device disk. It seems that
default path is root directory.
 
S

Safiiru no Baka

Hi I tried that. The path that VS dumps the DLL is \Program
Files\MyProject\ and I put that on the DllImport to the same results.

I tested using default DLLs (coredll.dll) and that works fine. Its
using custom DLLs that choke. Is there a tool out there to verify
whether the DLL is built properly for WCE?
 

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