I'm converting my applications to Delphi 2009 and faced an intriguing issue with some calls that need to convert a string (wide) to AnsiString.
Here's an example to demonstrate the issue I'm having:
var s: PAnsiChar; ... s := PAnsiChar(Application.ExeName);
With Delphi 2007 and previous versions, s := PChar(Application.ExeName) would return the application exe path.
with Delphi 2009, s := PAnsiChar(Application.ExeName) returns only 'E'.
My guess is that's because I'm converting a unicode string to an ansi string but how can I convert it so that a PAnsiChar gets the full string?