🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #567

Re: HELP : GetPrivateProfileString ??????

#567
From: Simon Lynton
Date: Sun, 02 May 1999 00:00
27 lines
1550 bytes
Hi

>
>iPath := PChar(ExtractFilePath(Application.ExeName) + 'test.ini');
>GetPrivateProfile('Option', 'KeyA', ' ', xStr, 80, iPath);
>....
>

I think iPath will be using the first few characters as the address instead
of the characters.

ie.
iPath is a pointer to a character array.
The result of Extract... is a string not a pointer to a string.

Try this

Const
    Null = chr(0);
var
    Tmp : String;
    iPath : PChar;
begin
    Tmp:= ExtractFilePath(Application.ExeName) + 'test.ini' + Null;
    iPath := @Tmp[1];

Simon
Technical Details
Message-ID: <sVMW2.5670$116.8383@news2.ozemail.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <372B03E4.C14208BB@sftw.umac.mo>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1091e5,d793697369ac48cf,start
X-Google-Attributes: gid1091e5,public
X-Google-Thread: 1043cf,d793697369ac48cf,start
X-Google-Attributes: gid1043cf,public
X-Google-Thread: 10baee,d793697369ac48cf,start
X-Google-Attributes: gid10baee,public
X-Google-Thread: fd817,d793697369ac48cf,start
X-Google-Attributes: gidfd817,public
From: "Simon Lynton" <sklynton@ozemail.com.au>
Subject: Re: HELP : GetPrivateProfileString ??????
Date: 1999/05/02
Message-ID: <sVMW2.5670$116.8383@news2.ozemail.com.au>
X-Deja-AN: 473026755
References: <372B03E4.C14208BB@sftw.umac.mo>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
X-Trace: news2.ozemail.com.au 925604568 203.108.42.71 (Sun, 02 May 1999 10:22:48 EST)
Organization: OzEmail Ltd, Australia
NNTP-Posting-Date: Sun, 02 May 1999 10:22:48 EST
Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.lang.borland-delphi,borland.public.delphi.objectpascal,borland.public.delphi.winapi