christine21

Hi all, I'm using C# to write the windows mobile 2003 application and deployed on the smartphone.

I used the method

[DllImport ("vam.dll")]
public extern void detect(string xmlFile, string imgName);

to import the dll into the application "Debug" folder.

i call the dll funcion using
detect("xmlFile", myImage);

My application is to detect the region on the image file automatically on the desktop and it runs successfully on the desktop version.

Now, i have to migrate my existing automatic detecion of region on desktop to the smartphone. I using the same method mentioned above, there is no compile error found. But, when i run on the smartphone, I get the error while running.

The error is "NotSupported"
Is it due to the dll problem If i remove the line where i call the dll function, it works fine.

I've put the dll in the same folder of the application folder in smartphone. I cannot put the dll in CAB file.

Can somebody tell me what's e problem




Re: Smart Devices VB and C# Projects how to load dll file in smartphone?

Michael Koster

Hi

This is definitly a problem with the 'vam.dll' binary. I assume you copied DLL you're using on the desktop to the device. This will not work - you need a version made for Windows Mobile 2003 based devices.

If this 'vam.dll' is a third party component, contact the vendor to get a Smartphone 2003 version.
If you have the source code (C/C++) for this component: Use Microsoft Visual C++ 2005 to port it to Windows Mobile 2003.

Hope this helps
Michael






Re: Smart Devices VB and C# Projects how to load dll file in smartphone?

christine21

Hi,

I did copy the DLL i using on desktop to the device. But, how am i going to create a version dll for windows mobile 2003 My DLL is actually a Matlab function compiled DLL which write in C++. May I know how to use VC++ 2005 port to WM2003

Besides, my application codes are written in C# and not C++.

I'm just basically using the 'vam.dll' for my application to call the specific function. How am i going to do that

Plss help~!

Thanks...

Cheers,
christine





Re: Smart Devices VB and C# Projects how to load dll file in smartphone?

Michael Koster

Hi Christine

First, check with Mathworks support whether they support Windows Mobile.

To create a WM 2003 DLL project, follow the steps described here: http://msdn2.microsoft.com/en-us/library/fbc0yasf(VS.80).aspx

As template select 'Win32 Smart Device project'. In the platform selection dialog, select the WM 2003 SDKs (Pocket PC and/or Smartphone) you want to support. In the next dialog, select DLL and check the 'Export symbols' checkbox. Once the the wizard completed creating the project, add all Mathlab generated C++ source files.
Now try to build the DLL project. If you get warnings or errors, try to fix em. Just be aware that this might be a non trivial task.

Hope this helps
Michael






Re: Smart Devices VB and C# Projects how to load dll file in smartphone?

christine21

Hi Michael,

Thanks for your help. But, i cannot find the "In the next dialog, select DLL and check the 'Export symbols' checkbox." which you mentioned in the reply.

Do you mean that besides add in the DLL only, i should add in the mathlab source files in the project as well Is it mean add the reference Because even if i add the reference, i still get the same error.

Any other method i can try


Thanks for your help.

Cheers,
christine





Re: Smart Devices VB and C# Projects how to load dll file in smartphone?

mgaur_MSFT

Christine,

Your problem is similar to issue with OpenCV.dll you faced. You're trying to load a DLL built for desktop onto a Smartphone/pocket pc. This will not work. You've to ask the DLL manufacturer to provide you with compatible DLLs for SP/PPC.

Manav