Message-ID: <38B4508A.754E1FFB@geocities.com> From: Sahab Yazdani Organization: PheonixSoft Inc. X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: something wierd is going on... References: <38B3192A DOT F17E3572 AT geocities DOT com> <8909up$mbp$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 53 Date: Wed, 23 Feb 2000 16:26:34 -0500 NNTP-Posting-Host: 209.103.53.98 X-Complaints-To: abuse AT sprint DOT ca X-Trace: newscontent-01.sprint.ca 951341550 209.103.53.98 (Wed, 23 Feb 2000 16:32:30 EST) NNTP-Posting-Date: Wed, 23 Feb 2000 16:32:30 EST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com the second problem is that since DrawString is a part of a class, showing you the source code would prove to be quite difficult (as people in the group might get mad). is filled with valid values using sprintf. My own system is Windows 98 (not SE) and I've tried it on Pure DOS (CSWDMPI), Windows 95, Windows 95 OSR 2, a couple other Windows 98 and a Windows 98 SE. and only my own system works fine... If it would help, the crash is a page fault and its a write error. I have tried symifying, but its really hard to tell what works and what doesn't when you can't check it on your own computer. thanks for your help people... Hans-Bernhard Broeker wrote: > > Sahab Yazdani wrote: > [...] > > writer->DrawString( x,y, "string", colour ); > > > it crashes on other computers (but not my own), yet when I use it like > > this: > > > char *string; > > /* I hope you filled 'string' with some useful value, between these, > * right? */ > > > writer->DrawString( x,y, string, colour ); > > > it works fine... now can anybody tell me whats going on?? > > It's a bit hard to tell, as you didn't show us your 'DrawString' > routine in source code. But here is a guess: you may be writing to the > string passed in, inside DrawString. But string constants like the > "string" in the above example are not writable, so you should get a > segmentation fault, from this. Why you do not get this erorr, on your > own machine, I do not know. Did you check out for possible differences > between your machine, and those it crashes on (operating system, DOS > box or true DOS mode?, if raw DOS, what's the DPMI server?)? > > At full warning level, I think gcc would have warned you about > dismissing a 'const' qualifier when you pass "string" to your routine. > -- *********************************************************** * Sahab Yazdani * "We are all who we are, no more and no * * Thornhill S.S * less" - al'Lan Mandragoran * *********************************************************** * http://pheonixware.8m.com/ * ***********************************************************