TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Coridon Henshaw
from: Peter Fitzsimmons
date: 1996-03-10 04:20:16
subject: Wierd Watcom problem w/ DLLs

PF> If you have already made the decision that some 
 PF> code is so isolated that it
 PF> belongs in a DLL,

 CH> The code is not isolated - it's used by several EXEs in the same package.

So your decision to put the code in a DLL was based on reuse;  fine idea. 
The next step is to MAKE it isolated.

If you gave me some idea of your API i'd probably be able to suggest a
logical "close" or "destroy" api.

For example,  I have a "file find"  library that I use a lot, 
which follows a standard open ... close model.

 FFIND *FindOpen(char *FileSpec);
 FindNext(FFIND *);
 FindClose(FFIND *);

That FindClose() doesn't do much more than free() some stuff is no-one
else's business.

There is no shame in writing the following,  if it makes the design more
complete (and it will save you ass when you add some feature that requires
a little more 'destruction' work):

    void CloseSomething(void *p)
    {
       free(p);
    }

When you use C++ classes,  this type of approach is a natural part of the language.


--- Maximus/2 3.00
* Origin: Sol 3 * Toronto * V.32 * (905)858-8488 (1:259/414)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 259/414 400 99 250/99 3615/50 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.