🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer.misc
1 messages
1 total messages Started by Keith Bennett Fri, 28 Apr 1995 00:00
Ill Effects of Including an .obj in .dll & .exe (DosMonReg)?
#183
Author: Keith Bennett
Date: Fri, 28 Apr 1995 00:00
39 lines
2348 bytes
What is the effect of including an object module both in a .DLL and
in and .EXE that uses that .DLL (under OS/2)?  

[I'm posting this message both in OS/2 specific and general C++ areas
because it pertains to both.]

I posted a message a few days ago asking for help with a problem I
was having with DosMonReg().  (This function is used to register a
function that intercepts printer output.)

It was returning an error code 379 (Invalid Parameter) for no
apparent reason.  The call was in a DLL.  Other apps that used that
same DLL had no problem.

After making a change, the problem has disappeared.  I would like to
find out if the change solved the problem or merely submerged it.

This is what fixed it: There was an object file that was included
both in the .DLL and the .EXE.  This object file was minimal (about
400 bytes) so wasted space was not really a problem.  But when I
removed it from the .DLL the problem went away.

The object file is truly tiny, containing a single one-line function
and a single static char array.  It is in a separate file in order to
be logically consistent with the way we handle other files.  (It
isn't logically related to anything else, and there's nothing else
that would need to be included with it.)

Does anyone know why the problem went away and whether the duplicate
inclusion was the cause of the problem?

Thanks for any help.
- Keith

-- 
--------------------------------------------------------------------------
Keith Bennett                             Bennett Business Solutions, Inc.
Silver Spring, MD USA                     OS/2 & DOS Software Development
kbennett@cpcug.org                        (301) 871-7696
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads