-----Original Message-----
From: Jason Gauthier [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 22, 2002 6:32 PM
To: 'Bobby Hicks'
Cc: '[email protected]'
Subject: RE: Here's a wierd one.....
Can we see more code? Including the loop?
Sure:
-------------------main.cpp-------------------
void __fastcall TMainForm::FileOpen1Execute(TObject *Sender)
{
if (OpenDialog->Execute())
{
CreateMDIChild("Area Information", AREA);
CreateMDIChild("Room Data", ROOM);
CreateMDIChild("Mobile Data", MOBILE);
CreateMDIChild("Object Data", OBJECT);
CreateMDIChild("Reset Data", RESET);
CreateMDIChild("Shop Data", SHOP);
}
}
void __fastcall TMainForm::CreateMDIChild(String Name, int Section_Type)
{
TMDIChild *Child;
//--- create a new MDI child window ----
LoadType = Section_Type;
Child = new TMDIChild(Application);
Child->Caption = Name;
}
-------------------mdichild.cpp-------------------
void __fastcall TMDIChild::FormCreate(TObject *Sender)
{
switch ( LoadType )
{
case UNKNOWN: lblWarning->Visible = true; break;
case AREA: fraAreaData->Visible = true; break;
case ROOM: fraRoomData->Visible = true; break;
case MOBILE: fraMobData->Visible = true; break;
case OBJECT: fraObjectData->Visible = true; break;
case RESET: fraResetData->Visible = true; break;
case SHOP: fraShopData->Visible = true; break;
}
}
As you can see, it's not actually a "loop" per se, but 6 separate calls.
However, with each call, LoadType is set to the appropriate number as it
should be. But the switch statement is NOT working as it should. I even
changed the order of the case statement(though that should not matter) and
it still comes up with the UNKNOWN setting.