ShowModal Problem
The following code in VCL-function ShowModal can be found in Forms.Pas:
...
if Visible or not Enabled or (fsModal in FFormState) or
(FormStyle = fsMDIChild) then
raise EInvalidOperation.Create(SCannotShowModal);
...
Calling ShowModal causes the exception to be raised, i.e. the logical
statement seems to return false.
Test:
Before calling ShowModal in c++ a similar construction evaluates
true:
TMyForm* frm;
bool result;
frm = new TMyForme(Application);
TFormState fst = frm->FormState;
TFormStyle frmst = frm->FormStyle;
if ( (frm->Visible) ||
(!frm->Enabled) ||
(frm->FormState.Contains(fsModal)) ||
(frmst == fsMDIChild)
) result = false;
else
result = true;
frm->ShowModal(); // Will often return with exception raised, but not always.
Question:
Is there a known problem in calling the VCL?
I just converted from CBuilder4 to CBuilder5.
Thanks for any response...
- Udo