🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2013

Trouble with standard mode and a DLL

#2013
From: Nick Pemberton
Date: Sat, 06 Apr 1991 19:47
33 lines
2144 bytes
Greetings All.

I have a problem that I just can't seem to find a reference to in the
SDK Docs. Its quite possible that the answer is so obvious that it
doesn't deserve to be in print, however, I am new at windows
programming.

I am trying to develop a DLL that provides a number of applications with
a generic read/write interface to a remote PICK based host, using a
serial port. Development has gone well, and I have a working prototype. Or
thought I had. I have developed this on a 386 box, running in enhanced
mode. Until yesterday, I thought all was well, but when I loaded it
onto a 286, running in standard mode, the DLL crashes the machine on exit.
It does the same thing on the 386 if run in standard mode.

I have narrowed it down to a specific section of code that is killing it.
When all applications exit that are using the DLL, the DLL is also
destroyed, as layed out in the SDK docs. In my WEP procedure, I want to
check an internal data structure that tells me if the remote hosts have
been left in a connected state when the applications exited. If they have,
I want to send a command to them telling them to close down. I send a
STOP message over the appropriate serial port using WriteComm(), and wait
for a moment to allow the serial port to transmit the command before
calling FlushComm and CloseComm to release things back to windows. If I
comment out the WriteComm command, the DLL works just fine on a 286.

Any ideas what I've done wrong? What is the difference between standard
and enhanced mode that lets WriteComm() work in the shutdown stages of
a DLL in 386 enhanced mode? Incidently, the serial communications work
fine in 286 mode during the normal lifespan of the DLL; its just on shutdown
that it gets in trouble. 

Using Codeview, I've been able t
Technical Details
Message-ID: <8898@aimed.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!lethe!tvcent!comspec!telly!attcan!ncrcan!aimed!nick

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!lethe!tvcent!comspec!telly!attcan!ncrcan!aimed!nick
From: nick@aimed.UUCP (Nick Pemberton)
Newsgroups: comp.windows.ms.programmer
Subject: Trouble with standard mode and a DLL
Message-ID: <8898@aimed.UUCP>
Date: 6 Apr 91 19:47:54 GMT
Organization: AIM, Inc, Toronto, Ontario
Lines: 39