Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I have the next function in an

Status
Not open for further replies.

ern297

Programmer
Nov 28, 2002
13
ES
Hi,

I have the next function in an old dll.

myType function(unsigned long *var1, unsigned long var2, wchar_t *var3);

I want to export this function to C#, and I try the next

[DllImport("myLib.dll", EntryPoint="function")]
public static extern myType myNewFunction(ref uint var1, uint var2, ref string[]);

But when I try to use the function I recive a System.ExecutionEngineException.
Can somebody help me? I think that I've problems with wchar_t.
Thanks.

Ernesto.
 
Was the DLL compiled with UNICODE defined? If not, the wchar_t will be a single-byte string, not a Unicode string.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top