This is a multi-part message in MIME format.
------=_NextPart_000_00D7_01C3C634.8A06DB10
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Major problems w/ deadline tonight! :(
I've created a DLL with the SmartPhone SDK. I've created a .NET CF app =
and try to p/invoke a function in the DLL. I always get =
System.MissingMethodException.
I've copied the DLL to both my application's folder and in the \windows =
folder on the PocketPC.
Here's my DLL code (actually, this is all auto-generated by the SDK)
#ifdef MYSTUFF_EXPORTS
#define MYSTUFF_API __declspec(dllexport)
#else
#define MYSTUFF_API __declspec(dllimport)
#endif
// This is an example of an exported function.
MYSTUFF_API int fnMyStuff(void)
{
return 42;
}
Here's the .NET code:
[System.Runtime.InteropServices.DllImport("MyStuff.dll")]
public static extern int fnMyStuff();
private void DLLButton_Click(object sender, System.EventArgs e)
{
int DLLReturned =3D fnMyStuff();
MessageBox.Show(DLLReturned.ToString());
}
The fnMyStuff() line is what triggers the exception.
Any help is greatly appreciated.. and the sooner the better! :)
------=_NextPart_000_00D7_01C3C634.8A06DB10
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Major problems w/ deadline tonight! :(</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>I've created a DLL with the SmartPhone SDK. =
I've created=20
a .NET CF app and try to p/invoke a function in the DLL. I always =
get=20
System.MissingMethodException.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>I've copied the DLL to both my application's folder =
and in the=20
\windows folder on the PocketPC.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Here's my DLL code (actually, this is all =
auto-generated by=20
the SDK)</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>#ifdef MYSTUFF_EXPORTS<BR>#define MYSTUFF_API=20
__declspec(dllexport)<BR>#else<BR>#define MYSTUFF_API=20
__declspec(dllimport)<BR>#endif</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>// This is an example of an exported =
function.<BR>MYSTUFF_API=20
int fnMyStuff(void)<BR>{<BR> return 42;<BR>}</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Here's the .NET code:</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2> =20
[System.Runtime.InteropServices.DllImport("MyStuff.dll")]<BR> =
=20
public static extern int fnMyStuff();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2> private void=20
DLLButton_Click(object sender, System.EventArgs=20
e)<BR> {<BR></FONT><FONT=20
size=3D2> int =
DLLReturned =3D=20
fnMyStuff();<BR> =20
MessageBox.Show(DLLReturned.ToString());<BR>  =
;=20
}</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>The fnMyStuff() line is what triggers the=20
exception.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Any help is greatly appreciated.. and the sooner the =
better!=20
:)</FONT></DIV></BODY></HTML>
------=_NextPart_000_00D7_01C3C634.8A06DB10--