🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.language.delphi.dotnet
1 messages
1 total messages Started by bourgui Thu, 26 Feb 2009 02:25
String typecasting a PChar in .NET?
#197
Author: bourgui
Date: Thu, 26 Feb 2009 02:25
27 lines
1732 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads