H
Hilton
Hi,
I wrote some simple DLL code, created a DLL called DLLTest.dll and copied it
to a directory on the Pocket PC:
#include "stdafx.h"
#include "DLLTest.h"
extern "C" __declspec(dllexport) int __cdecl Function1(void)
{
return 42;
}
I have tried various combination of the above; e.g. with/without __cdecl
etc.
--------------------
Then I wrote:
private void button1_Click(object sender, System.EventArgs ea)
{
MessageBox.Show (Function1().ToString());
}
[DllImport("DLLTest.dll", EntryPoint="Function1")] <--- I've
tried this without EntryPoint
static extern int Function1();
and put this EXE in the same directory. When I run the EXE, I get a
MissingMethodException, the message "Can't find PInvoke DLL 'DLLTest.dll'.
The DLL is definitely in the directory, so I'm thinking that I might need to
add/remove some linking options.
When I create the DLL project in VS2005, it setup these options for me:
/OUT:"Pocket PC 2003 (ARMV4)\Debug/DLLTest.dll" /INCREMENTAL /NOLOGO /DLL
/MANIFEST:NO /NODEFAULTLIB:"oldnames.lib" /DEF:".\DLLTest.def" /DEBUG
/PDB:"c:\stuff\dlltest\dlltest\pocket pc 2003 (armv4)\debug\DLLTest.pdb"
/STACK:65536,4096 /IMPLIB:"Pocket PC 2003 (ARMV4)\Debug/DLLTest.lib"
/ERRORREPORTROMPT ole32.lib oleaut32.lib uuid.lib
/subsystem:windowsce,4.20 /machine:ARM /ARMPADCODE
If you want me to stop going bald - help!
Hilton
I wrote some simple DLL code, created a DLL called DLLTest.dll and copied it
to a directory on the Pocket PC:
#include "stdafx.h"
#include "DLLTest.h"
extern "C" __declspec(dllexport) int __cdecl Function1(void)
{
return 42;
}
I have tried various combination of the above; e.g. with/without __cdecl
etc.
--------------------
Then I wrote:
private void button1_Click(object sender, System.EventArgs ea)
{
MessageBox.Show (Function1().ToString());
}
[DllImport("DLLTest.dll", EntryPoint="Function1")] <--- I've
tried this without EntryPoint
static extern int Function1();
and put this EXE in the same directory. When I run the EXE, I get a
MissingMethodException, the message "Can't find PInvoke DLL 'DLLTest.dll'.
The DLL is definitely in the directory, so I'm thinking that I might need to
add/remove some linking options.
When I create the DLL project in VS2005, it setup these options for me:
/OUT:"Pocket PC 2003 (ARMV4)\Debug/DLLTest.dll" /INCREMENTAL /NOLOGO /DLL
/MANIFEST:NO /NODEFAULTLIB:"oldnames.lib" /DEF:".\DLLTest.def" /DEBUG
/PDB:"c:\stuff\dlltest\dlltest\pocket pc 2003 (armv4)\debug\DLLTest.pdb"
/STACK:65536,4096 /IMPLIB:"Pocket PC 2003 (ARMV4)\Debug/DLLTest.lib"
/ERRORREPORTROMPT ole32.lib oleaut32.lib uuid.lib
/subsystem:windowsce,4.20 /machine:ARM /ARMPADCODE
If you want me to stop going bald - help!
Hilton