I have an unmanaged C ++ DLL that I need to call from a Windows Mobile C # application.
I have a C # shell and it works fine on the desktop. I can call DLL functions from a C # desktop program and pass strings without problems.
However, when I compile the lib and the wrapper for the mobile platform, I get an error message in the DllImport lines saying that CharSet.ANSI is not recognized. The only parameters that I am allowed to write are CharSet.Auto and CharSet.Unicode.
The problem is that regardless of this parameter, the strings received in C ++ functions are wide char strings, and not the regular char * strings they expect.
We can use wcstombs () to translate all the lines at the beginning of each C ++ function, but I would prefer not to modify lib to such an extent ...
Is there a way to fix marshalling between C # and C that works with the .NET Compact Framework?
c ++ c # interop windows-mobile compact-framework
tato
source share