🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Link VC++ DLL

#5885
From: KL Chin
Date: Thu, 23 Jun 2005 01:25
45 lines
2629 bytes
Hi Dennis,

Thank for you advice. Like you mentioned too much of work to
do, if single DLL will do it but too many dlls.

Regards
KL Chin

"Dennis Jones" <nospam@nospam.com> wrote in message 
news:42b9b096$1@newsgroups.borland.com...
>
> "KL Chin" <klchin@1asia.com.my> wrote in message
> news:42b90da0@newsgroups.borland.com...
>> Hi,
>>
>> I used 3rd party VC++ DLL, everything were working fine with my
>> program. Until when the 3rd party DLL had an update with extra
>> funtion, after going throught the debugging/tracing, I found that the
> static
>> call/jump to the DLL function was wrong address, instead of
>> call at Function_Init it call at Function_New.
>>
>> How to overcome this problem, I know re-import lib from the DLL,
>> but this could not solve the future dll.
>
> If the DLL adds or deletes functions, it is very likely that the function
> addresses will change, so you are almost always better off re-creating the
> import library if the DLL changes.  On the other hand, if the DLL only
> changes the behavior of existing functions, chances are good that the
> function addresses will not change (I believe the function addresses will 
> be
> independent of function size in the DLL, but I am not 100% sure about 
> that).
>
> The only way to guarantee never having to re-create the import library is 
> to
> not use an import library at all.  Instead of implicitly loading the DLL,
> explicitly load it with LoadLibrary() and use GetProcAddress() to locate 
> the
> functions in the DLL.  If you do that, you will never have to worry about
> the function addresses, but it is a bit more work.
>
> - Dennis
>
> 
Technical Details
Message-ID: <42ba0f76$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42b90da0@newsgroups.borland.com> <42b9b096$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c5261850dbffcc03
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "KL Chin" <klchin@1asia.com.my>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <42b90da0@newsgroups.borland.com> <42b9b096$1@newsgroups.borland.com>
Subject: Re: Link VC++ DLL 
Date: Thu, 23 Jun 2005 09:25:09 +0800
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 219.93.184.30
Message-ID: <42ba0f76$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1119489910 219.93.184.30 (22 Jun 2005 18:25:10 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail