From: Sinan_Unur AT mail DOT com (A. Sinan Unur) Newsgroups: comp.os.msdos.djgpp Subject: Re: They do NOT run the same! W95/DOS! Date: 27 Jun 2000 19:55:35 GMT Organization: Cornell University Lines: 56 Sender: verified_for_usenet AT cornell DOT edu (asu1 on 128.253.251.163) Message-ID: <8F60AAC2BASINANUNUR@132.236.56.8> References: NNTP-Posting-Host: 128.253.251.163 X-Trace: news01.cit.cornell.edu 962135735 6572 128.253.251.163 (27 Jun 2000 19:55:35 GMT) X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu NNTP-Posting-Date: 27 Jun 2000 19:55:35 GMT User-Agent: Xnews/03.04.11 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com radsmail AT juno DOT com (Radical NetSurfer) wrote in : >n 27 Jun 2000 18:18:53 GMT, "doug" wrote: > >>Radical NetSurfer schreef in artikel >>... >>> PLEASE HELP ME UNDERSTAND THE FOLLOWING: >>> >>> Why is it I find that most things compiled from a Win95 DOS shell >>> appear to work just fine... if allegro is used, the graphics and >>> mouse support is perfect.... >>> do into pure MS-DOS 6.22 and try to run the EXACT same program >>> and you get CORE-DUMPS and the MOUSE will HANG-THE-COMPUTER! ... > >Elaborate a little more, and it could be enlightening for all of us. >What examples provide clues as to when/why stability issues come into >play.... >It was fine until I started doing: > destroy_bitmap(da_bmp); > da_bmp=NULL; > >in DOS...this seems VERY NAUGHTY INDEED! you have a very interesting attitude. basically, the dpmi server under windows 9x will not properly catch some memory related exceptions. whereas cwsdpmi will. if your program seems to work under win95 but not in dos, this is a telltale sign that you have a memory related bug somewhere in your program. my guess is you are accessing da_bmp after you have destroyed it and set it to NULL. (btw, catching these kinds of programming errors _IS_ the reason for setting pointers which no longer point to valid storage to NULL.) for further enlightenment, you can test the following program under dos and in a dos window under windows 9x. #include int main(void) { char* nullpointer = NULL; *nullpointer = 'c'; return 0; } Sinan. -- -------------------------------- A. Sinan Unur http://www.unur.com/