Have you defined the draw window? If you haven't then you'll get an error like that. Try this before your "WinDraw" command...

if (!WinGetDrawWindow())
   WinSetDrawWindow(WinGetDisplayWindow());

and see if that helps get rid of the error. It may not be the solution that you need in the long term.

Bob.

Tony Janke wrote:

I am trying to draw a simple line on the screen, but get the error "Bad
Error"  Does anyone know why I get this error?


RGBColorType redRGB; IndexedColorType redIndexed;

redRGB.r = 255; redRGB.g = 0; redRGB.b = 0;
redIndexed = WinRGBToIndex(&redRGB);        // ERROR = bAD wINDOW
WinSetForeColor(redIndexed);
WinDrawLine(0, 0, 159, 159);


thanks,

~Tony






--
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to