🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4415

Re: GetEnvironmentVariable

#4415
From: Bob Gonder
Date: Mon, 06 Feb 2006 18:47
27 lines
1863 bytes
Joanne wrote:

>
>Hi,
>I am trying to use the function 
>AnsiString GetEnvironmentVariable(AnsiString mystring)
>as defined as a sysutils function by Borland C++
>I am getting an unresolved error from the linker. Do I need to 
>use a package or library to resolve this?


Since it uses and returns AnsiString, it is a VCL function.
You need to include the VCL libraries (if you are using the free
commanline version, those are not included in that distribution).

Alternatively, you could use the Win32 API versions:
GetEnvironmentStrings()
GetEnvironmentVariable()
FreeEnvironmentStrings()



DWORD GetEnvironmentVariable(
    LPCTSTR lpName,	// address of environment variable name 
    LPTSTR lpBuffer,	// address of buffer for variable value 
    DWORD nSize 		// size of buffer, in characters 
   );	
Technical Details
Message-ID: <cv5fu1d1ie53p85obhag3mhcojeo0qlpct@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43e73992$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,de09e7ac5120cd9c
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: GetEnvironmentVariable
Date: Mon, 06 Feb 2006 10:47:11 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <cv5fu1d1ie53p85obhag3mhcojeo0qlpct@4ax.com>
References: <43e73992$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.69.91.178
X-Trace: newsgroups.borland.com 1139251417 69.69.91.178 (6 Feb 2006 10:43:37 -0700)
Lines: 31
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail