Mail Archives: djgpp/2000/02/23/17:13:37
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). <string> 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 <beyonder69 AT geocities DOT com> 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/ *
***********************************************************
- Raw text -