Article View: borland.public.cppbuilder.nativeapi
Article #4297Re: GetEnvironmentVariable
From: Ed Mulroy
Date: Wed, 08 Feb 2006 14:45
Date: Wed, 08 Feb 2006 14:45
31 lines
1974 bytes
1974 bytes
The function prototype calls for an AnsiString by value and the code passes
it a char* literal.
See if this works:
Name = "USETNAME";
Name = GetEnvironmentVariable(Name);
. Ed
> Joanne wrote in message
> news:43e9b3ee$1@newsgroups.borland.com...
>
> The code fragment is as follows:-
> AnsiString Name;
>
> Name = GetEnvironmentVariable("USERNAME");
>
> The error message is:-
>
> [Linker Error] Unresolved external '__fastcall
> Sysutils::GetEnvironmentVariableA(const System::AnsiString)'
> referenced from C:\DOCUMENTS AND SETTINGS\MY
> DOCUMENTS\MYFILE.OBJ
>
> I am using Borland 6 Professional,
> the description of the routine in Borland is that it is in the
> SysUtils unit, defined as follows:-
>
> extern PACKAGE AnsiString__fastcall GetEnvironmentVariable
> (const AnsiString Name);
Technical Details
Message-ID:
<43ea0320$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43e73992$1@newsgroups.borland.com> <cv5fu1d1ie53p85obhag3mhcojeo0qlpct@4ax.com> <43e872ec$1@newsgroups.borland.com> <43e89e85$1@newsgroups.borland.com> <43e9b3ee$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: "Ed Mulroy" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <43e73992$1@newsgroups.borland.com> <cv5fu1d1ie53p85obhag3mhcojeo0qlpct@4ax.com> <43e872ec$1@newsgroups.borland.com> <43e89e85$1@newsgroups.borland.com> <43e9b3ee$1@newsgroups.borland.com> Subject: Re: GetEnvironmentVariable Date: Wed, 8 Feb 2006 09:45:15 -0500 Lines: 33 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 66.57.117.102 Message-ID: <43ea0320$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1139409696 66.57.117.102 (8 Feb 2006 06:41:36 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail