Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

String typecasting a PChar in .NET?

12 views
Skip to first unread message

bourgui

unread,
Feb 25, 2009, 9:25:32 PM2/25/09
to
Hi all,

I just started making the jump from D7 to 2009 .NET.
Simple question, how do you get a string from a PChar?

In D7, a simple typecast works. For example:

procedure Dummy;
var
myPChar : PChar;
myString : String;
begin
...
{ Some code that asigns something to myPChar }
myString := String(myPChar);

end;

In Delphi 2009, this gives an error message:
E2089 Invalid typecast

THis sounds like it should be simple, but I can't work it out, and
google's no help.

Thanks!

Bourgui

0 new messages