OleControl created for the wrong type - only when used in Reg Free COM?

I have an ActiveX control (created using C #) that I add to a form in Visual FoxPro using late binding. This works without problems when I register a control.

I want to use reg free COM and created the necessary manifest files. Now it loads and displays in an inactive state until I double-click or activate it grammatically. I do not think this has anything to do with reg free com manifest files. However, is there something I need to do to set it up before / after late binding of the AddObject() call?

 this.AddObject('OleControl1', 'oleControl', 'SomeCompany.SomeOleControl') 

When I check the OleTypeAllowed property of the OleControl created by AddObject() it is 1 (an inline OLE object) instead of -2 (an ActiveX object). Thus, OleControl was created for the wrong type.

I also tried the following:

  1. DEFINE subclass OleControl and set the property OleTypeAllowed = -2 . Late binding is used to load the control. This does not work as required. OleTypeAllowed back as 1

  2. An ActiveX control is registered. An ActiveX control has been added to the project as a subclass using a visual editor. Unregistered control. Late binding is used to load the control. This does not work as required. OleTypeAllowed back as 1 .

Can I load OleControl as an ActiveX control?

Any input from VB that I can convert to FoxPro will also be appreciated.

+5
source share
1 answer

You probably have the wrong miscStatusContent attribute. This is a snippet from the VB6 application manifest that we are deploying:

 <file name="External\COMCTL32.OCX"> <typelib tlbid="{6B7E6392-850A-101B-AFC0-4210102A8DA7}" version="1.3" flags="control,hasdiskimage" helpdir="" /> <comClass clsid="{9ED94440-E5E8-101B-B9B5-444553540000}" tlbid="{6B7E6392-850A-101B-AFC0-4210102A8DA7}" progid="COMCTL.TabStrip.1" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst"> <progid>COMCTL.TabStrip</progid> </comClass> .... </file> 

Note that miscStatus must be explicitly cleared.

We use UMMM to create a manifest in our automated builds.

0
source

Source: https://habr.com/ru/post/1310419/


All Articles