OleControl instantiated to wrong type - only when using in Reg Free COM?
Asked Answered
S

1

6

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

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

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

When I check the OleTypeAllowed Property of the OleControl created by AddObject() it is 1 (Embedded OLE object) instead of -2 (ActiveX object). So the OleControl got instantiated to the wrong type.

I also tried the following:

  1. DEFINE a subclass of OleControl and set the property OleTypeAllowed = -2. Used late binding to load the control. It did not work as required. The OleTypeAllowed came back as 1

  2. Registered the ActiveX control. Added the ActiveX control to the project as a subclass using the visual editor. Unregistered the control. Used late binding to load the control. It did not work as required. The OleTypeAllowed came back as 1.

Is it possible to load the OleControl as a ActiveX control?

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

Severe answered 20/5, 2010 at 19:34 Comment(3)
Could you add the manifest files you are using for Reg-Free COM?Decrease
Has anyone ever found a solution to this? FoxPro just refuses to load a .NET ActiveX control as an OLEControl. It's always treated as an OLEBoundControl.Realist
There may be additional dependencies that need to be in the local registration manifest. If the ActiveX control depends on other COM components (in the same unregistered DLL) those need to be in the manifest as well.Infatuation
I
0

You probably have the miscStatusContent attribute wrong. This a snippet from a VB6 app manifest we deploy:

<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>

Notice that miscStatus has to be explicitly cleared.

We are using UMMM for manifest creation in our automated builds.

Inexplicit answered 13/11, 2012 at 11:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.