Board index » cppbuilder » Using VCL forms in non VCL application

Using VCL forms in non VCL application

We have an application written using only the Windows API. The application
is MDI based. We have created some MDI Child VCL forms, and are trying to
incorporate into this non VCL based MDI parent. The VCL forms are in a
separate DLL. Sometimes when we try to set the focus to one of these forms
we get "Error 1400 Invalid Window handle" or "Win32 API Error". Once this
begins we are unable to ever set the focus to any of these VCL forms and
must shut the application down. Could this problem be because we are using a
standard message loop i.e. GetMessage, TranslateMessage and DispatchMessage
or could it be because our forms exist in a DLL?

Much thanks in advance!

James Higgins
TOSC International

 

Re:Using VCL forms in non VCL application


We had the same problem even when everything was done using VCL.
We tried to put all MDI child windows in a seperate dlls and tried to call them
from the main(MDI parent) window, we were not able to make it work
in dynamic loading. Finally we linked all the child MDI dlls statically!.

Quote
James Higgins wrote:
> We have an application written using only the Windows API. The application
> is MDI based. We have created some MDI Child VCL forms, and are trying to
> incorporate into this non VCL based MDI parent. The VCL forms are in a
> separate DLL. Sometimes when we try to set the focus to one of these forms
> we get "Error 1400 Invalid Window handle" or "Win32 API Error". Once this
> begins we are unable to ever set the focus to any of these VCL forms and
> must shut the application down. Could this problem be because we are using a
> standard message loop i.e. GetMessage, TranslateMessage and DispatchMessage
> or could it be because our forms exist in a DLL?

> Much thanks in advance!

> James Higgins
> TOSC International

  parikosh.vcf
< 1K Download

Re:Using VCL forms in non VCL application


It also may be because some windows-ish elements in the VCL aren't truly
windows (i.e., derived from TWinControl). Those don't have window handles.
So depending on how you use the MDI children you may be trying to reference
windows that aren't there.

--Michael

Other Threads