You may call FrmUpdateForm and do it inside the Update event.

Regards
Henk

Tam Hanna wrote:

Hi,
If I do it while handling a frmOpenEvent, the crash even occurs after the
FrmDrawForm call! The OS does some handling after wards, so is there an
event that I can use to do this without having to set the draw window
manually?
I already googled, but didn't find anything!
Best regards and thanks for the hint
Tam Hanna

Henk Jonas wrote:
Subject: Re: WinSetForeColor in form event handler kills simulator
From: Henk Jonas <[EMAIL PROTECTED]>
Date: Tue, 12 Jul 2005 23:46:34 +0200
X-Message-Number: 31

Tam Hanna wrote:


Hi Dudes,
I am currently porting over a project to PODS from OnBoardC. The PalmOS 5
simulator dies whenever a new form is opened. This is the beginning of the
event handler:

Boolean colorFormEventHandler(EventPtr pEvent)
{ Boolean handled = false;
        FormPtr pForm   = FrmGetActiveForm();
        RectangleType bounds;
        IndexedColorType oldc=WinSetForeColor(prefs.fore);
        switch (pEvent->eType)

I have already performed some testing and found out that the program

always

dies at the WinSetForeColor call. The simulator pops out the following
message:
Window.c Line 78 Bad Window

This is the last event I get:
Event # Timestamp       Type    Details
479     11.436  sysWinExit      enterWindow=0x0, exitWindow=0xF02788



Is a kind of FAQ: set up a draw window...



--
-------------------------------------------------------------------------
  Henk Jonas                                            [EMAIL PROTECTED]
  Palm OS ® certified developer

  Please contact me, if you need an off-side contract worker.
-------------------------------------------------------------------------

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

Reply via email to