System dependent DrawText error

BlitzMax Forums/MaxGUI Module/System dependent DrawText error

bubbz(Posted 2007) [#1]
Somebody commented that a MaxGUI program i'd written (see http://on.plu.to ) didn't run on their XP SP2 machine. I had tested it on several xp machines (including SP2) without a problem, but have since been able to find a machine that replicates their problem.

On the effected machines the program runs then crashes the first time it tries drawtext to one of the canvases. If I run a debug build from the MaxIDE i get an 'Unhandled Exception:Unhandled Memory Exception Error' on the line:

DrawText("0",20,graphysize-20)


The variable graphysize has been defined and is used without a problem a few lines before, removing the variable from the line makes no difference to the error. I'm currently using Brucey's fontconfig, but the error occurs without it too. The program usses two canvases and the first one has already used drawtext successfully when this error occurs.

What puzzles me most is that this error only occurs on certain pc's, the program works fine on the majority of machines i've tested it on. Has anybody come across this issue before, or can you suggest a solution? I've failed to replicate it in a shorter piece of code. I'm really puzzled.


klepto2(Posted 2007) [#2]
The problem maybe due to 2 canvases. Some graphicscards doesn't support multiple graphics devices.
I would try to change the graphicsdriver to OpenGL or if you already have done this, then change to DX on windows.


bubbz(Posted 2007) [#3]
klepto2: thanks for the reply, i've checked and this is not the cause of the error.

I wrote another quick gui program with two canvases on one of the problem machines and successfully used drawtext to write on both of them.

In my main program, I have actually already used drawtext on the canvas prior to the crash (in a different font, although it still crashes even if I don't change the font).

A few days ago I tried adding lots of extra drawtext commands in/around the problem part of the code and there seemed no pattern to which one it crashed on. For a particular piece of code it always crashed on the same one, but by adding/removing/changing the positions of the drawtext commands I could make it crash on a different one with no obvious reason why.

I am an inexperienced programmer, but the fact that my code runs on most machines suggests to me that this isn't an obvious error I have made. I would appreciate any help!

Thanks.