🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #1981

Re: DLLs and LIBPATH (Was: Re: Minor wishlist item: any IBMers out there?)

#1981
From: David Charlap
Date: Fri, 09 Oct 1992 19:09
24 lines
2024 bytes
In article <1992Oct07.192423.2842@ans.net> db3l@ans.net (David Bolen) writes:
>Note that this doesn't solve the problem when a DLL has functions
>removed from it's interface, as OS/2 will not even allow the
>application to start due to unresolved references.  So if you want to
>make sure and support backlevel applications, you have to at a minimum
>have stub functions for all previous revisions of your DLL to get by
>the load-time checking.

The solution is to structure your DLL as an API.  That is, every
function returns error codes, or zero for OK.  If values need to be
passed back, use output parameters.  Now, you do not EVER delete a
reference from the DLL.  Instead, you change the code so it just
returns a constant (you should define a constant like
FUNCTION_NOT_IMPLEMENTED for this purpose).

This way, references are always resolved by the linker, and your code
will always get far enough to check versions.  Plus, if you call a
function that hasn't been implemented, you know it from the non-zero
return code.
-- 
David Charlap         |"there aren't 50,000 things for which it's worth writing
dic5340@hertz.njit.edu| software; and the computer industry doesn't have enough
----------------------+ programmers to create that much good software.
Therefore, most of it must be worthless" -- Boris Beizer "The Frozen Keyboard"
Technical Details
Message-ID: <1992Oct9.190931.20869@njitgw.njit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340
References: <1992Oct6.214026.3576@networx.com> <1992Oct7.143622.1387@news.eng.convex.com> <1992Oct07.192423.2842@ans.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340
From: dic5340@hertz.njit.edu (David Charlap)
Newsgroups: comp.os.os2.programmer
Subject: Re: DLLs and LIBPATH (Was: Re: Minor wishlist item: any IBMers out there?)
Message-ID: <1992Oct9.190931.20869@njitgw.njit.edu>
Date: 9 Oct 92 19:09:31 GMT
References: <1992Oct6.214026.3576@networx.com> <1992Oct7.143622.1387@news.eng.convex.com> <1992Oct07.192423.2842@ans.net>
Sender: news@njit.edu
Organization: New Jersey Institute of Technology, Newark, N.J.
Lines: 24
Nntp-Posting-Host: hertz.njit.edu