Pointer of ^Pchar to array of PCharUsing a COM DLL in delphi - Access violation in MSVCR80D.dll errorHow to pass string indexes for OleVariantuac elevate while using ifileoperation copyitemFunction written in Delphi2010 COM object not visible in C# .netclient side web serviceCannot make DragAcceptFiles work when using a dialog boxPChar Invalid Pointer Operation on StrPLCopyIs PChar('') guaranteed to be a pointer to #0 (not nil)?Delphi XE3 Invalid Pointer when trying to free FSQL (TStringList)Another Delphi Invalid Pointer Operation

What would cause a nuclear power plant to break down after 2000 years, but not sooner?

Why should I pay for an SSL certificate?

6502: is BCD *fundamentally* the same performance as non-BCD?

Output with the same length always

Select elements of a list by comparing it to another list

Why does auto deduce this variable as double and not float?

What should I do if actually I found a serious flaw in someone's PhD thesis and an article derived from that PhD thesis?

What is the spellcasting ability of a Barbarian Totem Warrior?

Weird resistor with dots around it on the schematic

Set theory with antielements?

How do I pass a "list of lists" as the argument to a function of the form F[x,y]?

When does The Truman Show take place?

Why do we use low resistance cables to minimize power losses?

Scam? Phone call from "Department of Social Security" asking me to call back

Upside down reversion for a Greek letter

What should I do with the stock I own if I anticipate there will be a recession?

Is the Microsoft recommendation to use C# properties applicable to game development?

Eric Andre had a dream

How does the Moon's gravity affect Earth's oceans despite Earth's stronger gravitational pull?

A+ rating still unsecure by Google Chrome's opinion

What should we do with manuals from the 80s?

What's a good pattern to calculate a variable only when it is used the first time?

Is Fourier series a sampled version of Fourier transform?

A Magic Diamond



Pointer of ^Pchar to array of PChar


Using a COM DLL in delphi - Access violation in MSVCR80D.dll errorHow to pass string indexes for OleVariantuac elevate while using ifileoperation copyitemFunction written in Delphi2010 COM object not visible in C# .netclient side web serviceCannot make DragAcceptFiles work when using a dialog boxPChar Invalid Pointer Operation on StrPLCopyIs PChar('') guaranteed to be a pointer to #0 (not nil)?Delphi XE3 Invalid Pointer when trying to free FSQL (TStringList)Another Delphi Invalid Pointer Operation






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















when i migrate from Delphi 6 to Delphi 10.2 Tokyo
i get error when i try to casting pointer of ^PChar to array of PChar



type
PServEnt = ^TServEnt;
TServEnt = packed record
s_name: PChar; // official service name
s_aliases: ^PChar; // alias list
s_port: Smallint; // protocol to use
s_proto: PChar; // port #
end;

function TIdStackWindows.WSGetServByPort(
const APortNumber: Integer): TIdStrings;
var
ps: PServEnt;
i: integer;
p: array of PChar;
begin
Result := TIdStringList.Create;
p := nil;
try
ps := GetServByPort(HToNs(APortNumber), nil);
if ps <> nil then
begin
Result.Add(ps^.s_name);
i := 0;
p := Pointer(ps^.s_aliases); // get error Incompatible types: 'Dynamic array' and 'Pointer'
while p[i] <> nil do
begin
Result.Add(PChar(p[i]));
inc(i);
end;
end;
except
Result.Free;
end;
end;


this code working well at Delphi 2010 ,how to make it correct at Delphi 10.2 Tokyo










share|improve this question
























  • FYI, this is EXTREMELY OLD Indy code. TIdStringList no longer exists in Indy, it was removed in 2007. TIdStackWindows.WSGetServByPort() was updated for Unicode in 2010, and later re-written as TIdStackWindows.AddServByPortToList(). It is implemented quite a bit differently than what has been shown here. You need to upgrade to an up-to-date version of Indy.

    – Remy Lebeau
    Mar 27 at 19:54












  • Thank you @RemyLebeau ,i used Indy10 comes with Delphi 10.2, all errors have gone

    – Deaa Darawsheh
    Mar 28 at 7:18

















1















when i migrate from Delphi 6 to Delphi 10.2 Tokyo
i get error when i try to casting pointer of ^PChar to array of PChar



type
PServEnt = ^TServEnt;
TServEnt = packed record
s_name: PChar; // official service name
s_aliases: ^PChar; // alias list
s_port: Smallint; // protocol to use
s_proto: PChar; // port #
end;

function TIdStackWindows.WSGetServByPort(
const APortNumber: Integer): TIdStrings;
var
ps: PServEnt;
i: integer;
p: array of PChar;
begin
Result := TIdStringList.Create;
p := nil;
try
ps := GetServByPort(HToNs(APortNumber), nil);
if ps <> nil then
begin
Result.Add(ps^.s_name);
i := 0;
p := Pointer(ps^.s_aliases); // get error Incompatible types: 'Dynamic array' and 'Pointer'
while p[i] <> nil do
begin
Result.Add(PChar(p[i]));
inc(i);
end;
end;
except
Result.Free;
end;
end;


this code working well at Delphi 2010 ,how to make it correct at Delphi 10.2 Tokyo










share|improve this question
























  • FYI, this is EXTREMELY OLD Indy code. TIdStringList no longer exists in Indy, it was removed in 2007. TIdStackWindows.WSGetServByPort() was updated for Unicode in 2010, and later re-written as TIdStackWindows.AddServByPortToList(). It is implemented quite a bit differently than what has been shown here. You need to upgrade to an up-to-date version of Indy.

    – Remy Lebeau
    Mar 27 at 19:54












  • Thank you @RemyLebeau ,i used Indy10 comes with Delphi 10.2, all errors have gone

    – Deaa Darawsheh
    Mar 28 at 7:18













1












1








1








when i migrate from Delphi 6 to Delphi 10.2 Tokyo
i get error when i try to casting pointer of ^PChar to array of PChar



type
PServEnt = ^TServEnt;
TServEnt = packed record
s_name: PChar; // official service name
s_aliases: ^PChar; // alias list
s_port: Smallint; // protocol to use
s_proto: PChar; // port #
end;

function TIdStackWindows.WSGetServByPort(
const APortNumber: Integer): TIdStrings;
var
ps: PServEnt;
i: integer;
p: array of PChar;
begin
Result := TIdStringList.Create;
p := nil;
try
ps := GetServByPort(HToNs(APortNumber), nil);
if ps <> nil then
begin
Result.Add(ps^.s_name);
i := 0;
p := Pointer(ps^.s_aliases); // get error Incompatible types: 'Dynamic array' and 'Pointer'
while p[i] <> nil do
begin
Result.Add(PChar(p[i]));
inc(i);
end;
end;
except
Result.Free;
end;
end;


this code working well at Delphi 2010 ,how to make it correct at Delphi 10.2 Tokyo










share|improve this question














when i migrate from Delphi 6 to Delphi 10.2 Tokyo
i get error when i try to casting pointer of ^PChar to array of PChar



type
PServEnt = ^TServEnt;
TServEnt = packed record
s_name: PChar; // official service name
s_aliases: ^PChar; // alias list
s_port: Smallint; // protocol to use
s_proto: PChar; // port #
end;

function TIdStackWindows.WSGetServByPort(
const APortNumber: Integer): TIdStrings;
var
ps: PServEnt;
i: integer;
p: array of PChar;
begin
Result := TIdStringList.Create;
p := nil;
try
ps := GetServByPort(HToNs(APortNumber), nil);
if ps <> nil then
begin
Result.Add(ps^.s_name);
i := 0;
p := Pointer(ps^.s_aliases); // get error Incompatible types: 'Dynamic array' and 'Pointer'
while p[i] <> nil do
begin
Result.Add(PChar(p[i]));
inc(i);
end;
end;
except
Result.Free;
end;
end;


this code working well at Delphi 2010 ,how to make it correct at Delphi 10.2 Tokyo







delphi delphi-10.2-tokyo char-pointer






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 12:32









Deaa DarawshehDeaa Darawsheh

304 bronze badges




304 bronze badges















  • FYI, this is EXTREMELY OLD Indy code. TIdStringList no longer exists in Indy, it was removed in 2007. TIdStackWindows.WSGetServByPort() was updated for Unicode in 2010, and later re-written as TIdStackWindows.AddServByPortToList(). It is implemented quite a bit differently than what has been shown here. You need to upgrade to an up-to-date version of Indy.

    – Remy Lebeau
    Mar 27 at 19:54












  • Thank you @RemyLebeau ,i used Indy10 comes with Delphi 10.2, all errors have gone

    – Deaa Darawsheh
    Mar 28 at 7:18

















  • FYI, this is EXTREMELY OLD Indy code. TIdStringList no longer exists in Indy, it was removed in 2007. TIdStackWindows.WSGetServByPort() was updated for Unicode in 2010, and later re-written as TIdStackWindows.AddServByPortToList(). It is implemented quite a bit differently than what has been shown here. You need to upgrade to an up-to-date version of Indy.

    – Remy Lebeau
    Mar 27 at 19:54












  • Thank you @RemyLebeau ,i used Indy10 comes with Delphi 10.2, all errors have gone

    – Deaa Darawsheh
    Mar 28 at 7:18
















FYI, this is EXTREMELY OLD Indy code. TIdStringList no longer exists in Indy, it was removed in 2007. TIdStackWindows.WSGetServByPort() was updated for Unicode in 2010, and later re-written as TIdStackWindows.AddServByPortToList(). It is implemented quite a bit differently than what has been shown here. You need to upgrade to an up-to-date version of Indy.

– Remy Lebeau
Mar 27 at 19:54






FYI, this is EXTREMELY OLD Indy code. TIdStringList no longer exists in Indy, it was removed in 2007. TIdStackWindows.WSGetServByPort() was updated for Unicode in 2010, and later re-written as TIdStackWindows.AddServByPortToList(). It is implemented quite a bit differently than what has been shown here. You need to upgrade to an up-to-date version of Indy.

– Remy Lebeau
Mar 27 at 19:54














Thank you @RemyLebeau ,i used Indy10 comes with Delphi 10.2, all errors have gone

– Deaa Darawsheh
Mar 28 at 7:18





Thank you @RemyLebeau ,i used Indy10 comes with Delphi 10.2, all errors have gone

– Deaa Darawsheh
Mar 28 at 7:18












1 Answer
1






active

oldest

votes


















4














The error message is correct, and if the code compiled in earlier versions of Delphi then that was because those earlier versions of the compiler were deficient.



A dynamic array is more than just a pointer to the first element. It also encapsulates the meta data which stores the length of the array, and the reference count. Your cast is therefore not valid. You got away with this invalid code because you did not attempt to access this meta data, but that's as much by chance as through intention.



Don't attempt to cast to a dynamic array. Instead use pointer arithmetic. For instance:



function TIdStackWindows.WSGetServByPort(
const APortNumber: Integer): TIdStrings;
var
ps: PServEnt;
p: PPChar;
begin
Result := TIdStringList.Create;
try
ps := GetServByPort(HToNs(APortNumber), nil);
if ps <> nil then
begin
Result.Add(ps^.s_name);
p := PPChar(ps^.s_aliases); // cast needed due to Indy record type's use of un-nameable type
while p^ <> nil do
begin
Result.Add(p^);
inc(p);
end;
end;
except
Result.Free;
raise;
end;
end;


I changed the type declaration of the alias list to PPChar to avoid incompatible type errors when assigning to the local variable of that type.



Note also that I have corrected your exception handling which was previously swallowing exceptions and returning an invalid object reference.






share|improve this answer



























  • thanks for your solution ,but i get "Incompatible types" error at p := ps^.s_aliases; but if i use p := Pointer(ps^.s_aliases); the error goes,is there any impact for that?

    – Deaa Darawsheh
    Mar 27 at 13:35











  • That's fine, it just suppresses strict type checking. Better would be to use PPChar in place of ^PChar.

    – David Heffernan
    Mar 27 at 13:48











  • Thank you ,i used p: PPChar; and the casting p := PPChar(ps^.s_aliases); compiled without errors

    – Deaa Darawsheh
    Mar 27 at 14:03











  • Change both record field and local variable to that type and you don't need to cast. Although if that's an Indy type then you are stuck with the cast.

    – David Heffernan
    Mar 27 at 14:09







  • 1





    FYI, getservbyport() returns data using Ansi strings, there is no Unicode version, so you need to use PPAnsiChar instead of PPChar in Delphi 2009+.

    – Remy Lebeau
    Mar 27 at 19:56










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55377291%2fpointer-of-pchar-to-array-of-pchar%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














The error message is correct, and if the code compiled in earlier versions of Delphi then that was because those earlier versions of the compiler were deficient.



A dynamic array is more than just a pointer to the first element. It also encapsulates the meta data which stores the length of the array, and the reference count. Your cast is therefore not valid. You got away with this invalid code because you did not attempt to access this meta data, but that's as much by chance as through intention.



Don't attempt to cast to a dynamic array. Instead use pointer arithmetic. For instance:



function TIdStackWindows.WSGetServByPort(
const APortNumber: Integer): TIdStrings;
var
ps: PServEnt;
p: PPChar;
begin
Result := TIdStringList.Create;
try
ps := GetServByPort(HToNs(APortNumber), nil);
if ps <> nil then
begin
Result.Add(ps^.s_name);
p := PPChar(ps^.s_aliases); // cast needed due to Indy record type's use of un-nameable type
while p^ <> nil do
begin
Result.Add(p^);
inc(p);
end;
end;
except
Result.Free;
raise;
end;
end;


I changed the type declaration of the alias list to PPChar to avoid incompatible type errors when assigning to the local variable of that type.



Note also that I have corrected your exception handling which was previously swallowing exceptions and returning an invalid object reference.






share|improve this answer



























  • thanks for your solution ,but i get "Incompatible types" error at p := ps^.s_aliases; but if i use p := Pointer(ps^.s_aliases); the error goes,is there any impact for that?

    – Deaa Darawsheh
    Mar 27 at 13:35











  • That's fine, it just suppresses strict type checking. Better would be to use PPChar in place of ^PChar.

    – David Heffernan
    Mar 27 at 13:48











  • Thank you ,i used p: PPChar; and the casting p := PPChar(ps^.s_aliases); compiled without errors

    – Deaa Darawsheh
    Mar 27 at 14:03











  • Change both record field and local variable to that type and you don't need to cast. Although if that's an Indy type then you are stuck with the cast.

    – David Heffernan
    Mar 27 at 14:09







  • 1





    FYI, getservbyport() returns data using Ansi strings, there is no Unicode version, so you need to use PPAnsiChar instead of PPChar in Delphi 2009+.

    – Remy Lebeau
    Mar 27 at 19:56















4














The error message is correct, and if the code compiled in earlier versions of Delphi then that was because those earlier versions of the compiler were deficient.



A dynamic array is more than just a pointer to the first element. It also encapsulates the meta data which stores the length of the array, and the reference count. Your cast is therefore not valid. You got away with this invalid code because you did not attempt to access this meta data, but that's as much by chance as through intention.



Don't attempt to cast to a dynamic array. Instead use pointer arithmetic. For instance:



function TIdStackWindows.WSGetServByPort(
const APortNumber: Integer): TIdStrings;
var
ps: PServEnt;
p: PPChar;
begin
Result := TIdStringList.Create;
try
ps := GetServByPort(HToNs(APortNumber), nil);
if ps <> nil then
begin
Result.Add(ps^.s_name);
p := PPChar(ps^.s_aliases); // cast needed due to Indy record type's use of un-nameable type
while p^ <> nil do
begin
Result.Add(p^);
inc(p);
end;
end;
except
Result.Free;
raise;
end;
end;


I changed the type declaration of the alias list to PPChar to avoid incompatible type errors when assigning to the local variable of that type.



Note also that I have corrected your exception handling which was previously swallowing exceptions and returning an invalid object reference.






share|improve this answer



























  • thanks for your solution ,but i get "Incompatible types" error at p := ps^.s_aliases; but if i use p := Pointer(ps^.s_aliases); the error goes,is there any impact for that?

    – Deaa Darawsheh
    Mar 27 at 13:35











  • That's fine, it just suppresses strict type checking. Better would be to use PPChar in place of ^PChar.

    – David Heffernan
    Mar 27 at 13:48











  • Thank you ,i used p: PPChar; and the casting p := PPChar(ps^.s_aliases); compiled without errors

    – Deaa Darawsheh
    Mar 27 at 14:03











  • Change both record field and local variable to that type and you don't need to cast. Although if that's an Indy type then you are stuck with the cast.

    – David Heffernan
    Mar 27 at 14:09







  • 1





    FYI, getservbyport() returns data using Ansi strings, there is no Unicode version, so you need to use PPAnsiChar instead of PPChar in Delphi 2009+.

    – Remy Lebeau
    Mar 27 at 19:56













4












4








4







The error message is correct, and if the code compiled in earlier versions of Delphi then that was because those earlier versions of the compiler were deficient.



A dynamic array is more than just a pointer to the first element. It also encapsulates the meta data which stores the length of the array, and the reference count. Your cast is therefore not valid. You got away with this invalid code because you did not attempt to access this meta data, but that's as much by chance as through intention.



Don't attempt to cast to a dynamic array. Instead use pointer arithmetic. For instance:



function TIdStackWindows.WSGetServByPort(
const APortNumber: Integer): TIdStrings;
var
ps: PServEnt;
p: PPChar;
begin
Result := TIdStringList.Create;
try
ps := GetServByPort(HToNs(APortNumber), nil);
if ps <> nil then
begin
Result.Add(ps^.s_name);
p := PPChar(ps^.s_aliases); // cast needed due to Indy record type's use of un-nameable type
while p^ <> nil do
begin
Result.Add(p^);
inc(p);
end;
end;
except
Result.Free;
raise;
end;
end;


I changed the type declaration of the alias list to PPChar to avoid incompatible type errors when assigning to the local variable of that type.



Note also that I have corrected your exception handling which was previously swallowing exceptions and returning an invalid object reference.






share|improve this answer















The error message is correct, and if the code compiled in earlier versions of Delphi then that was because those earlier versions of the compiler were deficient.



A dynamic array is more than just a pointer to the first element. It also encapsulates the meta data which stores the length of the array, and the reference count. Your cast is therefore not valid. You got away with this invalid code because you did not attempt to access this meta data, but that's as much by chance as through intention.



Don't attempt to cast to a dynamic array. Instead use pointer arithmetic. For instance:



function TIdStackWindows.WSGetServByPort(
const APortNumber: Integer): TIdStrings;
var
ps: PServEnt;
p: PPChar;
begin
Result := TIdStringList.Create;
try
ps := GetServByPort(HToNs(APortNumber), nil);
if ps <> nil then
begin
Result.Add(ps^.s_name);
p := PPChar(ps^.s_aliases); // cast needed due to Indy record type's use of un-nameable type
while p^ <> nil do
begin
Result.Add(p^);
inc(p);
end;
end;
except
Result.Free;
raise;
end;
end;


I changed the type declaration of the alias list to PPChar to avoid incompatible type errors when assigning to the local variable of that type.



Note also that I have corrected your exception handling which was previously swallowing exceptions and returning an invalid object reference.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 27 at 14:11

























answered Mar 27 at 13:00









David HeffernanDavid Heffernan

533k35 gold badges872 silver badges1273 bronze badges




533k35 gold badges872 silver badges1273 bronze badges















  • thanks for your solution ,but i get "Incompatible types" error at p := ps^.s_aliases; but if i use p := Pointer(ps^.s_aliases); the error goes,is there any impact for that?

    – Deaa Darawsheh
    Mar 27 at 13:35











  • That's fine, it just suppresses strict type checking. Better would be to use PPChar in place of ^PChar.

    – David Heffernan
    Mar 27 at 13:48











  • Thank you ,i used p: PPChar; and the casting p := PPChar(ps^.s_aliases); compiled without errors

    – Deaa Darawsheh
    Mar 27 at 14:03











  • Change both record field and local variable to that type and you don't need to cast. Although if that's an Indy type then you are stuck with the cast.

    – David Heffernan
    Mar 27 at 14:09







  • 1





    FYI, getservbyport() returns data using Ansi strings, there is no Unicode version, so you need to use PPAnsiChar instead of PPChar in Delphi 2009+.

    – Remy Lebeau
    Mar 27 at 19:56

















  • thanks for your solution ,but i get "Incompatible types" error at p := ps^.s_aliases; but if i use p := Pointer(ps^.s_aliases); the error goes,is there any impact for that?

    – Deaa Darawsheh
    Mar 27 at 13:35











  • That's fine, it just suppresses strict type checking. Better would be to use PPChar in place of ^PChar.

    – David Heffernan
    Mar 27 at 13:48











  • Thank you ,i used p: PPChar; and the casting p := PPChar(ps^.s_aliases); compiled without errors

    – Deaa Darawsheh
    Mar 27 at 14:03











  • Change both record field and local variable to that type and you don't need to cast. Although if that's an Indy type then you are stuck with the cast.

    – David Heffernan
    Mar 27 at 14:09







  • 1





    FYI, getservbyport() returns data using Ansi strings, there is no Unicode version, so you need to use PPAnsiChar instead of PPChar in Delphi 2009+.

    – Remy Lebeau
    Mar 27 at 19:56
















thanks for your solution ,but i get "Incompatible types" error at p := ps^.s_aliases; but if i use p := Pointer(ps^.s_aliases); the error goes,is there any impact for that?

– Deaa Darawsheh
Mar 27 at 13:35





thanks for your solution ,but i get "Incompatible types" error at p := ps^.s_aliases; but if i use p := Pointer(ps^.s_aliases); the error goes,is there any impact for that?

– Deaa Darawsheh
Mar 27 at 13:35













That's fine, it just suppresses strict type checking. Better would be to use PPChar in place of ^PChar.

– David Heffernan
Mar 27 at 13:48





That's fine, it just suppresses strict type checking. Better would be to use PPChar in place of ^PChar.

– David Heffernan
Mar 27 at 13:48













Thank you ,i used p: PPChar; and the casting p := PPChar(ps^.s_aliases); compiled without errors

– Deaa Darawsheh
Mar 27 at 14:03





Thank you ,i used p: PPChar; and the casting p := PPChar(ps^.s_aliases); compiled without errors

– Deaa Darawsheh
Mar 27 at 14:03













Change both record field and local variable to that type and you don't need to cast. Although if that's an Indy type then you are stuck with the cast.

– David Heffernan
Mar 27 at 14:09






Change both record field and local variable to that type and you don't need to cast. Although if that's an Indy type then you are stuck with the cast.

– David Heffernan
Mar 27 at 14:09





1




1





FYI, getservbyport() returns data using Ansi strings, there is no Unicode version, so you need to use PPAnsiChar instead of PPChar in Delphi 2009+.

– Remy Lebeau
Mar 27 at 19:56





FYI, getservbyport() returns data using Ansi strings, there is no Unicode version, so you need to use PPAnsiChar instead of PPChar in Delphi 2009+.

– Remy Lebeau
Mar 27 at 19:56








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55377291%2fpointer-of-pchar-to-array-of-pchar%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript