Groups | Blog | Home
all groups > dotnet compact framework > september 2005 >

dotnet compact framework : Problems using c++ library from c#


xmardaras NO[at]SPAM gmail.com
9/21/2005 5:35:13 AM
Hello,

I have a missingmethodexception when I try to use it.
I use eVC++ 4.0 and PPC 2003.
I know that the dll is in the same folder that the application is
executed.
I get this exception, incluso even when I return nothin and with no
parameters in the function.
I have declared the function in one of my .cpp:

extern "C" void __declspec(dllexport) __cdecl Recog();

extern "C" void __declspec(dllexport) __cdecl Recog()
{
MessageBox(NULL,TEXT("Hello, I'm inside."),TEXT("Hello, I'm
inside."),MB_OK);
//Do something, The messagebox is not shown

}

In c# I use:

[DllImport("Reconocedor_DLL.dll")]
static extern void Recog();

I have tried with SetLastError, EntryPoint,... but nothing I have the
same exception.

Please help.

Best Regards.
xmardaras NO[at]SPAM gmail.com
9/21/2005 7:46:33 AM
Thanks for your reply.

Yes, it apperas there in clean text, it's not decorated, and the
processor type is correct ARM.

I've tried with empty libraries that exposes a single function, and
this runs ok.
I think it could be a problem with:(Supposing):
- Dependencies of my library in runtime, but It compiles ok.
-With precompiled headers, I another project with automatic precompiled
headers, the same exception, but it can be derived from the firs error
type.

Thanks.
Chris Tacke, eMVP
9/21/2005 10:28:16 AM
If you run dumpbin.exe on the DLL, does it show the function is exported?
Have you compiled the DLL for the correct processor?

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


[quoted text, click to view]

xmardaras NO[at]SPAM gmail.com
9/23/2005 1:34:35 AM
I've found the problem, my library has some dependencies to another
libraries, so my library has to be in the same folder of the other
libraries
AddThis Social Bookmark Button