🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Correction: GetProcAddress return type

#12084
From: Muzzy
Date: Thu, 25 Dec 2003 14:47
30 lines
1860 bytes
Todd Brylski wrote:
> "Muzzy" <leyandrew@yahoo.com> wrote in message news:3fea818c$1@newsgroups.borland.com...
> 
>>typedef bool* (*HVPNSTART)(void);
> 
> 
> It should be this:
>     typedef bool (*HVPNSTART)(void);
> 
> and this:
>     HVPNSTART vs = (HVPNSTART)GetProcAddress(hLib, "_VPNStart");
> 
> Todd
> 

Yeap, guys, my problem was in wrong typdef. As Todd correctly said it 
should be

typedef bool (*HVPNSTART)(void);

instead of typedef bool* (*HVPNSTART)(void);

Because in first case return value would always be true - 'vs' will 
return address of boolean value instead of boolean value itself, which 
will be always true...

I figured it out at around 4 am last night :)

Thanks guys,
Andrey
Technical Details
Message-ID: <3feaf896$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3fea7f6e$1@newsgroups.borland.com> <3fea818c$1@newsgroups.borland.com> <3feabf9a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,3d934f741828d59c
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-12-25 06:49:08 PST
Date: Thu, 25 Dec 2003 09:47:38 -0500
From: Muzzy <leyandrew@yahoo.com>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Correction:  GetProcAddress return type
References: <3fea7f6e$1@newsgroups.borland.com> <3fea818c$1@newsgroups.borland.com> <3feabf9a$1@newsgroups.borland.com>
In-Reply-To: <3feabf9a$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 24.91.233.60
Message-ID: <3feaf896$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1072363670 24.91.233.60 (25 Dec 2003 06:47:50 -0700)
Lines: 31
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail