Board index » delphi » PChars and C Chars

PChars and C Chars

I am having problems sharing my D3 DLL with a CPP program.   The function
in question is as follows:

function ConvertSSN ( SSN : pchar; var ID : pchar ) : integer; stdcall;
export;

In the function, I have dumped SSN and ID to a text file for debugging
purposes both before I make changes and after.  All looks well.  My Delphi
test program that uses the DLL works fine.

Now the problem:  A CPP program can load and run the DLL using other
functions just fine but when they call the above function, the value
returned in ID is garbage.  The dumped text file shows good data just as
the Delphi test program.  I have even removed the VAR and it worked fine in
Delphi but still won't in CPP.  

Any ideas?

Thanks,
Bill

 

Re:PChars and C Chars


how did you define the function in CPP?

Cheers,
Anco.

Other Threads