DrawText issues

slyprid
07-10-2005, 07:52 PM
The project i'm currently working on is giving me some odd errors. At first it was crashing it, but I resolved that. Now instead of crashing the program, all the text that appears in the game just disappears. I'm using the commands surface.drawtext(...) to draw the text.
This is the error my error logger is catching.

NEW ERROR: 7/10/2005 8:48:28 PMSystem.ArgumentNullException: Value cannot be null.
at Microsoft.DirectX.DirectDraw.Surface.set_ForeColor(Color value)
at N2O___Game_Client.Form1.DrawTime() in D:\Documents and Settings\Slyprid\My Documents\Visual Studio Projects\N2O\N2O - Game Client\frmMain.vb:line 294
Extra info: DRAWTIME
~END ERROR~

Unfortunately its the same error throughout the entire program. From the looks of it, once one does it, the entire program blows up. My error logger logs like 30 drawtext errors when it happens. Also it keeps saying that the surface.forecolor value cannot be null, but all of them have values. So would it be easier to fix this, or scrap it and use a font set made from images. Thanks for your time.

Slyprid

slyprid
07-10-2005, 08:40 PM
Just noticed that this leads the pack of errors when it removes the text.

NEW ERROR: 7/10/2005 9:31:28 PMError in the application.
-2005532087 (DDERR_CANTCREATEDC)
at Microsoft.DirectX.DirectDraw.Surface.DrawText(Int32 x, Int32 y, String text, Boolean drawAtLastPosition)
at N2O___Game_Client.Form1.DrawChat() in D:\Documents and Settings\Slyprid\My Documents\Visual Studio Projects\N2O\N2O - Game Client\frmMain.vb:line 262
Extra info:
~END ERROR~

Slyprid

slyprid
07-10-2005, 09:05 PM
Well from the looks of what i've been looking up this is a memory leak. Not sure why though. Is there anyway to free DC up when I use a drawtext command? Otherwise I think i'll have to go to a fontset using images.

Slyprid

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum