|
Question about NT/2000 vs 98
I am writing a program in which I need to display text on the screen at the same time I am displaying graphics. The code I have compiles and runs perfectly under win98, but on my professor's computers(one NT, the other Win2K), it crashes when I run it returning a memory error? It will run fine on his computers if I comment out the text section. I am using the print function from NeHe's 13th tutorial to display the text... Here's the code just in case it'll help...
Does anyone have an idea of what the problem is?
HardSniper
Edited by - HardSniper on November 13, 2001 12:44:34 PM
HardSniper
November 13, 2001 03:32 PM
Just what exactly is the error? NT4/5 catches all the sloppy code that win9x can''t. Sounds like a pointer error.
I''m not on my professors machine now, but it was something like memory error at 0x000000 or something to that effect...
HardSniper
HardSniper
HardSniper
"Could not access memory at location 0x0000000" or something? If I remember correctly, this is usually caused by a null pointer exception, or by overrunning the bounds of an array. I think it''s usually the latter, where you are trying to do something like list[9] = 3, when list is an array of 8 elements. Maybe that will help.
"Could not access memory at location 0x0000000" or something? If I remember correctly, this is usually caused by a null pointer exception, or by overrunning the bounds of an array. I think it''s usually the latter, where you are trying to do something like list[9] = 3, when list is an array of 8 elements. Maybe that will help.
It''s got nothing to do with unicode. All the libraries for NT implement non-unicode versions (all they do is convert all your text strings to unicode before calling the "proper" functions). It is recommended you use unicode on Windows NT/2000, but this is only a performance concern, since converting from ANSI strings to unicode is time-consuming.
There is possibly a few reasons for your problem. The most likely is that you call glPrint incorrectly. Code like this:
will compile with no trouble, but will give you access violations (since vsprintf will be expecting two integer arguments but only gets one). Also, code like this:
Will also compile without problems, but will cause problems when vsprintf is looking for a string and finds an integer, or finds a string when looking for an integer (though the latter would work OK, since a string is just a pointer, which in turn is just an integer).
If you suspect this is the problem, try commenting out the vsprintf stuff and just call glCallLists() on fmt instead of text. See how that goes.
Any code that runs under Windows 95 should work on Windows NT/2000 - as long as they "play nice". Windows NT/2000/XP are move unforgiving of incorrect parameters and such (just like Windows 95 is more unforgiving than was Windows 3.1)
codeka.com - Just click it.
There is possibly a few reasons for your problem. The most likely is that you call glPrint incorrectly. Code like this:
|
will compile with no trouble, but will give you access violations (since vsprintf will be expecting two integer arguments but only gets one). Also, code like this:
|
Will also compile without problems, but will cause problems when vsprintf is looking for a string and finds an integer, or finds a string when looking for an integer (though the latter would work OK, since a string is just a pointer, which in turn is just an integer).
If you suspect this is the problem, try commenting out the vsprintf stuff and just call glCallLists() on fmt instead of text. See how that goes.
Any code that runs under Windows 95 should work on Windows NT/2000 - as long as they "play nice". Windows NT/2000/XP are move unforgiving of incorrect parameters and such (just like Windows 95 is more unforgiving than was Windows 3.1)
codeka.com - Just click it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement