MissingmethodException in C#SmartDevice project Can't find Pinvoke DLL.
-
Thursday, January 07, 2010 7:36 AMHi,I am getting this error. when i am importing a dll from c++ appliaction.in my C# code i am importing this dll like this[DllImport("Assemble.dll", EntryPoint = "Settpdu")]static extern void Settpdu(byte[] VALUE);in my C++ code i am exporting this function like thisextern "C" __declspec(dllexport) void Settpdu(BYTE * VALUE);but once i am running this i am getting exception like.if any one please help me? what is the problem?
All Replies
-
Thursday, January 07, 2010 9:38 AM
Did you make sure the native DLL is deployed to the target device? Also, you need to be aware of the fact that DllImport expects the DLL either to exist in the current path, or you need to specify a fully qualified path.
-
Thursday, January 07, 2010 10:52 AM
Hi dudepans,
Please find the same discussion in thread below :
http://social.msdn.microsoft.com/Forums/en/windowsmobiledev/thread/3fb84992-13a3-4d05-9072-280c1d7f8787
Hope this may helpful..
Thanks, Mohsin Shaikh. If you find my post is helpful for you then mark it as answer. -
Friday, January 08, 2010 9:24 AMHi ,i try the depndency tool to test my Aseemble.dll.i am getting following error do you have any idea about this, following are the information.1.Error: At least one required implicit or forwarded dependency was not found.2.Error: Modules with different CPU types were found.If you can able to help me on this that will be great.
-
Friday, January 08, 2010 9:24 AMHi ,i try the depndency tool to test my Aseemble.dll.i am getting following error do you have any idea about this, following are the information.1.Error: At least one required implicit or forwarded dependency was not found.2.Error: Modules with different CPU types were found.If you can able to help me on this that will be great.
-
Monday, January 11, 2010 6:07 AM
Hi,
I've never used the "dependency tool". But the errors sound like your dll was not compiled towards the same platform as your target platform.
Hope this helps,
Zhe Zhao- Marked As Answer by ZHE ZHAO Wednesday, January 13, 2010 4:45 AM
-
Tuesday, January 12, 2010 2:22 AMHi ZHE ZHAO,I have very common question. first time i am working on C# projects,Can we use a dll implemented in C++ in to my C# project.Using a Pinvoke?RegardsPravi
-
Tuesday, January 12, 2010 3:44 AMYes, we can.
For more detail about Pinvoke please refer to
An Introduction to P/Invoke and Marshaling
Advanced P/Invoke
Hope this helps,
Zhe Zhao

