Re: Upcoming win32lib v0.70.4a

new topic     » goto parent     » topic index » view thread      » older message » newer message

CChris wrote:
> 
> * Mike777 (or Judith, or anyone else who chanced upon the issue): I need some
> evidence of what is going on when recreating a control and something goes
> wrong.
> Do you have any?

Not too much.  Here's a description.  I have a main window with two combo boxes
used to select client and project.  Once selected, there is a command button
which reads those two combo boxes and from the combination, understands where to
find a text file that has a whole slew of newUIObj commands.  I use that text
file to build a series of controls.  All works as expected.  The very first
control that is built, by convention is a tab control.  All other controls are
descendants of that tab control.

I have a menu item: File|New which is intended to essentially start the program
over.

It executes the following:

setVisible({cboBox1,lblcboBox1,cboBox2,lblcboBox2,cmdStartProgram},w32True)
destroy(getNameId("tabControlMain"))

When I execute the above, it works fine.

However, when I re-execute the command button (pointing to the same text file) I
get an error message with the following:

Error code 459
create():Invalid parent id.

W32Lib v0.70.4 15-Mar-2008

Press enter ....

So I comment out the above two lines and replace them with:

shellExecute("open","RerunMyProgram.bat",SW_SHOWNORMAL)
abort(1)

Where ReRunMyProgram has the following in it:

START MYPROGRAM.Exe && EXIT

Which, does what I want in that I now have my program opened, memory cleared and
my selection boxes again available. If I set the combos and select the command
button, the controls are again built without a problem.

I did some debugging and found that on the rebuild, I successfully place the
main tab control, and a series of tab items (pages).  It is only when trying to
add the first control to a tab item does the program abort with an invalid parent
message.

I tried a number of controls (combos, labels, text boxes) they all abort.  So
there is something about establishing the tab item control the second time around
which doesn't allow it to be referenced as a parent.

While I haven't 100% confirmed this, here are 3 lines which if they are the only
controls built should give an error when the combo is built:

Control:"TabControl,Main Tab 
Control,tabMainControl,0,0,1200,950,parent=Window1"

Control:"TabItem,Client Info,tbiClientInfo,parent=tabMainControl,initialfocus=1"

Control:"Combo,cboFirst,cboFirst,100,40,60,140,parent=tbiClientInfo

Mike

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu