The problem: when using the component as isolated COM, the window is hidden
as soon as it lose the focus. Gaining the focus, makes the component to be
visible again.
The solution: It is a manifest problem. The object was not getting properly activated from a DataFlex point of view. The reason is that various flags that tell our runtime what kind of COM object this is, were missing. The fact that it works with a C# is not relevant as we are talking about different focus mechanisms. It worked in the registry because the registry had the right flag settings.
Specifically, there are these things called MiscStatus flags. The OLEMISC
type describes the values for the MiscStatus flags.
These flags are stored in the registry when the object is registered. You will see this under:
HKEY_CLASSES_ROOT\CLSID\{clsid}\ MiscStatus is 1, and it should be 131473.
This information needs to be in the manifest file, but it is not. This causes the problem.
The manifest should contain the following:
<comClass clsid="{clsid}" tlbid="{typelibid}"
miscStatusContent="recomposeonresize,setclientsitefirst,activatewhenvisible,cantlinkinside,insideout">
</comClass>
The flags that should not be missing are: activatewhenvisible and
setclientsitefirst. The clsid is the class identifier for the main object in
the component, while typelibid is the identifier of the control's type
library.
For instance, the manifest file for exg2antt
component may look as follows:
<file name="ExG2antt.dll">
<comClass clsid="{CD481F4D-2D25-4759-803F-752C568F53B7}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="G2antt Class" miscStatusContent="recomposeonresize,setclientsitefirst,activatewhenvisible,cantlinkinside,insideout"></comClass>
<comClass clsid="{2DD65709-C0BA-4764-AADF-820919FF181B}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Column Class"></comClass>
<comClass clsid="{28AC7755-06AC-4439-9ADD-EA012B4B2F10}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Columns Class"></comClass>
<comClass clsid="{1801677D-52FE-4759-B10A-C4FE70EAE035}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Items Class"></comClass>
<comClass clsid="{E2B55693-3D70-426B-9E08-ECF9DC93D98D}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="OleEvent Class"></comClass>
<comClass clsid="{919D16E8-2002-4C11-BC81-1CA0FF8FDDEF}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="OleEventParam Class"></comClass>
<comClass clsid="{C39F7717-C8C1-44A0-A495-DB5E92FDC79D}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Appearance Class"></comClass>
<comClass clsid="{9E3FB380-6CB7-4CCA-B726-FE191133A8A0}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="ExDataObjectFiles Class"></comClass>
<comClass clsid="{A30C0D8D-98A5-476B-860A-3397645BA8F8}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="ExDataObject Class"></comClass>
<comClass clsid="{4B82A833-421F-496F-BE2F-F5C41DBED707}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Template Class"></comClass>
<comClass clsid="{D4D088E8-0FA5-4414-A322-D105149D6313}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="TemplatePage Class"></comClass>
<comClass clsid="{1AA7ABFA-8C27-4579-9F06-7CCFAF301B72}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Editor Class"></comClass>
<comClass clsid="{23AA3A91-C107-44B2-BD23-3978B343DB8A}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Chart Class"></comClass>
<comClass clsid="{7862FEFF-7FE6-401A-A692-CE4758CDD0FC}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Level Class"></comClass>
<comClass clsid="{D6C57467-EC60-429F-87B7-3751DFB1EEAE}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Bar Class"></comClass>
<comClass clsid="{75A35E6C-2144-435F-96FF-0BE4A9643176}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Bars Class"></comClass>
<comClass clsid="{FC5F6509-4354-4D92-A9A9-24EEB081670E}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="ConditionalFormat Class"></comClass>
<comClass clsid="{DEDF38EB-BEEA-48D1-8D9E-AF0C81FA8E71}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="ConditionalFormats Class"></comClass>
<comClass clsid="{91E561B9-B514-4F1F-BAE1-3E5903C85DA3}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="InsideZoomFormat Class"></comClass>
<comClass clsid="{513CF640-A498-4800-ACEF-4473491CF282}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="InsideZoom Class"></comClass>
<comClass clsid="{B6528DA9-8C75-4389-9B72-EE8A8C2BABA3}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="InsideZooms Class"></comClass>
<comClass clsid="{15F8B91F-49AD-4663-B878-8A3DE05E4A30}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Notes Class"></comClass>
<comClass clsid="{926F669D-85C4-4D6D-BC9D-BA3759D8B237}" tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" description="Note Class"></comClass>
<typelib tlbid="{70337FFD-810F-4CDC-B09A-44CDCEE7DF1B}" resourceid="1" version="1.0" helpdir=""></typelib>
</file>
Thanks to Support of Visual DataFlex and Bernhard Ponemayr, from Comtech IT Systeme, Austria, who provided
the note and help for syntax of Visual DataFlex programming language.