Photonic Weirdness.

im have a function that checks to see if a widget inside another
dialog exists by using:

if (ABW_phTextBox)
{
SetResource(abw_phTextBox… etc
etc…

}

this code chunk works fine … its doesn’t try to update a non existent
textbox when the dialog doesn’t exist, and updates when the dialog
does exist… heres where it gets weird…

if i close the dialog. the program coredumps with a memory error. it
seems that even though the dialog (and presumably the widgets within
it) doesn’t exist the result of abw_phTextBox is not null…

any ideas?

vince

vince <vgeisler@engineer.com> wrote:

im have a function that checks to see if a widget inside another
dialog exists by using:

if (ABW_phTextBox)
{
SetResource(abw_phTextBox… etc
etc…

}

this code chunk works fine … its doesn’t try to update a non existent
textbox when the dialog doesn’t exist, and updates when the dialog
does exist… heres where it gets weird…

if i close the dialog. the program coredumps with a memory error. it
seems that even though the dialog (and presumably the widgets within
it) doesn’t exist the result of abw_phTextBox is not null…

In general, the ABW pointers are not reset to NULL when you destroy
their widget. The only exception is the main widget (window) of a
dialog module – your code will work if you change ABW_phTextBox to
ABW_phDialog (or whatever the dialog is called) in the if condition.


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.