J
Jack P
Hi All,
I am new to DLL, I created a native DLL for Windows application (windows
xp/vista...), it works.
I tried to implement same thing to compact framework ( for windows
mobile/ppc), but can't get work yet...
The run time error is NotSupportedException, but the same thing in windows
application are working fine...
I can see this in my stdafx.h
#define WINVER _WIN32_WCE
so I think it should be right for config but ... still can't work.
Please help.
Thanks.
JB.
The managed code to use DLL:
////////////////////////////
namespace JBDlltest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
double xy = ImplementNativeDll.Add(6.0, 5.0); //////////////
will happen NotSupportedException
}
}
public class ImplementNativeDll
{
[DllImport(@"C:\Users\JB\Documents\Visual Studio
2008\Projects\dllll\dllll\Windows Mobile 5.0 Pocket PC SDK
(ARMV4I)\Debug\dllll.dll", EntryPoint = "Add")]
public static extern double Add(double x, double y);
}
}
and
The native DLL:
/////////////////////////////////////////////////
#include "stdafx.h"
extern "C" __declspec(dllexport) double Add(double x, double y);
__declspec(dllexport) double Add(double x, double y)
{
return (x*y);
}
I am new to DLL, I created a native DLL for Windows application (windows
xp/vista...), it works.
I tried to implement same thing to compact framework ( for windows
mobile/ppc), but can't get work yet...
The run time error is NotSupportedException, but the same thing in windows
application are working fine...
I can see this in my stdafx.h
#define WINVER _WIN32_WCE
so I think it should be right for config but ... still can't work.
Please help.
Thanks.
JB.
The managed code to use DLL:
////////////////////////////
namespace JBDlltest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
double xy = ImplementNativeDll.Add(6.0, 5.0); //////////////
will happen NotSupportedException
}
}
public class ImplementNativeDll
{
[DllImport(@"C:\Users\JB\Documents\Visual Studio
2008\Projects\dllll\dllll\Windows Mobile 5.0 Pocket PC SDK
(ARMV4I)\Debug\dllll.dll", EntryPoint = "Add")]
public static extern double Add(double x, double y);
}
}
and
The native DLL:
/////////////////////////////////////////////////
#include "stdafx.h"
extern "C" __declspec(dllexport) double Add(double x, double y);
__declspec(dllexport) double Add(double x, double y)
{
return (x*y);
}