pinvoke WM5

G

Guest

I have posted this before but I am not sure where I left off and I am still
having an issue with it.

I have the exact same code that works on Windows Mobile 5 Pocket PC Ed. on
two different Ipaqs and a Palm Treo Phone.

I create a SmartPhone build for the same stuff and everything works fine
except pinvoke throws an exception claiming there is a "Missing Method".

Is there any special differences between SmartPhone version and Pocket PC
version for pinvoking a custom dll?

Thank you very much.
 
P

Paul G. Tobey [eMVP]

Not in how you do it, but in what APIs are available, yes.

Paul T.
 
G

Guest

Well I mean like the following:

[DllImport("MyDLL.dll",CharSet=CharSet.Unicode,SetLastError=true)]
public static extern bool MyMethod();

where I define in my native dll:

extern "C" {
MYDLL_API BOOL MyMethod();
};
 
P

Paul G. Tobey [eMVP]

Well, if you're sure that your native DLL is in a suitable location and that
the missing method exception isn't being thrown because of an error on your
part, it could be a lack of your application and DLL being signed and the
SmartPhone locked. I would expect that it's more likely to be your fault
for that particular exception, though.

Paul T.

Jeremy said:
Well I mean like the following:

[DllImport("MyDLL.dll",CharSet=CharSet.Unicode,SetLastError=true)]
public static extern bool MyMethod();

where I define in my native dll:

extern "C" {
MYDLL_API BOOL MyMethod();
};

Paul G. Tobey said:
Not in how you do it, but in what APIs are available, yes.

Paul T.
 
G

Guest

I have the dll alongside the application in the same directory although it is
invisible on the device itself I can see it using windows explorer on my
desktop. Someone mentioned it needed to be in the Windows directory so I
tried copying it there and that didnt work either. Like I said it works
perfect on Pocket PC edition, just not SmartPhone.

Jeremy said:
Well I mean like the following:

[DllImport("MyDLL.dll",CharSet=CharSet.Unicode,SetLastError=true)]
public static extern bool MyMethod();

where I define in my native dll:

extern "C" {
MYDLL_API BOOL MyMethod();
};

Paul G. Tobey said:
Not in how you do it, but in what APIs are available, yes.

Paul T.
 
P

Paul G. Tobey [eMVP]

Well, when all of the possible explanations are exhausted, start with the
impossible. Signing is the first thing that comes to my mind, anyway. You
might try testing that by writing a *native code* application to call that
DLL and see what happens with it.

Paul T.

Jeremy said:
I have the dll alongside the application in the same directory although it
is
invisible on the device itself I can see it using windows explorer on my
desktop. Someone mentioned it needed to be in the Windows directory so I
tried copying it there and that didnt work either. Like I said it works
perfect on Pocket PC edition, just not SmartPhone.

Jeremy said:
Well I mean like the following:

[DllImport("MyDLL.dll",CharSet=CharSet.Unicode,SetLastError=true)]
public static extern bool MyMethod();

where I define in my native dll:

extern "C" {
MYDLL_API BOOL MyMethod();
};

Paul G. Tobey said:
Not in how you do it, but in what APIs are available, yes.

Paul T.

I have posted this before but I am not sure where I left off and I am
still
having an issue with it.

I have the exact same code that works on Windows Mobile 5 Pocket PC
Ed. on
two different Ipaqs and a Palm Treo Phone.

I create a SmartPhone build for the same stuff and everything works
fine
except pinvoke throws an exception claiming there is a "Missing
Method".

Is there any special differences between SmartPhone version and
Pocket PC
version for pinvoking a custom dll?

Thank you very much.
 
G

Guest

I see it now I wasnt signing the dll properly.

Thanks for pointing me in the right direction.

Paul G. Tobey said:
Well, when all of the possible explanations are exhausted, start with the
impossible. Signing is the first thing that comes to my mind, anyway. You
might try testing that by writing a *native code* application to call that
DLL and see what happens with it.

Paul T.

Jeremy said:
I have the dll alongside the application in the same directory although it
is
invisible on the device itself I can see it using windows explorer on my
desktop. Someone mentioned it needed to be in the Windows directory so I
tried copying it there and that didnt work either. Like I said it works
perfect on Pocket PC edition, just not SmartPhone.

Jeremy said:
Well I mean like the following:

[DllImport("MyDLL.dll",CharSet=CharSet.Unicode,SetLastError=true)]
public static extern bool MyMethod();

where I define in my native dll:

extern "C" {
MYDLL_API BOOL MyMethod();
};

:

Not in how you do it, but in what APIs are available, yes.

Paul T.

I have posted this before but I am not sure where I left off and I am
still
having an issue with it.

I have the exact same code that works on Windows Mobile 5 Pocket PC
Ed. on
two different Ipaqs and a Palm Treo Phone.

I create a SmartPhone build for the same stuff and everything works
fine
except pinvoke throws an exception claiming there is a "Missing
Method".

Is there any special differences between SmartPhone version and
Pocket PC
version for pinvoking a custom dll?

Thank you very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top