Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!caen!uflorida!mlb.semi.harris.com!trantor.harris-atd.com!trantor!dsampson From: dsampson@x102a.harris-atd.com (sampson david 58163) Newsgroups: comp.windows.ms.programmer Subject: Re: Windows hanging & DLL problems Message-ID: Date: 22 Mar 91 15:32:50 GMT References: <449@newmedia.UUCP> Sender: news@trantor.harris-atd.com Organization: Harris Gov't Aerospace Systems Division Lines: 51 In-reply-to: jim@newmedia.UUCP's message of 22 Mar 91 04:00:23 GMT Jim -- your email address bounces at my site so I'll post instead. You don't say whether you're doing anything in your DLLs during initialization, like GlobalAlloc, GlobalLock, GlobalUnlock calls, etc. As a drop back and punt approach, try creating dummy DLLs for test purposes that only contain the MS code for LibEntry and WEP, and link that to your application. Purposly get rid of your DLLs for the time being. If the problem re-occurs, the it's in your Non-DLL code. If it goes away, try bringing in 1 dll at a time until you isolate down to the problem module. Whenever I hear about random behavior in any code (usually my own on a day to day basis :)) I always suspect memory allocation that's messed up, a pointer that's declared but doesn't have any space allocated to it, or a pointer that points to an object that was created by a MS lib call. This last item is usually missed by people and can result in some severe behavior problems. To see if you have this particular problem, see if you have a pointer to an object in memory that's created by MS. I ran into this in the GetProfileStrings function. If you pass NULL as the second parameter, MS "creates" a list of the LHS stuff in a section of your win.ini file. I had a pointer point to the list that they created so that I could parse the data. Fine. That worked and I got the data. But when I wanted to exit my function where this was going on, I had to steer my pointer variable away from the MS data before exiting my function or it would hang the system (randomly). I fixed it by making the thing point to NULL before I exited the function. Everything works fine now. I'm not saying this is your particular problem. You have some fault isolation to do yet. But be aware that where a chrash occurs may not be DIRECTLY correlated to where the problem actually resides (ain't pointers wonderful????) -- A new world record in the javalin throw / / / I ------------------------------------------------- David Sampson Harris Corporation dsampson@x102a.ess.harris.com Gov't Aerospace Systems Divison uunet!x102a!dsampson Melbourne, Florida -------------------------------------------------------------------------------