I have a DLL, written in XE2 that takes a PChar as a parameter (therefore being a unicode string). I was hoping to write an application in Delphi 2006 that calls this DLL. Is this possible, how do I pass in the PChar parameter? If I was doing it in Delphi XE2 I would simply do:
tmpString := 'hello';
DLL_Call(PChar(tmpString));
I have tried defining my tmpString as a WideString in Delphi 2006, but I believe a WideString and an XE2 Unicode string differ considerably?
Is there a way I can pass the string correctly to the DLL? I am in control of the DLL source code so I could obviously change the function definition to PAnsiChar but I'd prefer not to do this, I was hoping for a solution from the Delphi 2006 side if possible.
PXxxChar
buffers and their lengths, rather than var-string so I don't have to use the borland shared mem dll – Warren P