>Hello All,
>
>Here is the short question: how do I instantiate a class/control if I only have the Class ID?
>
>Here is the longer explanation:
>
>I am doing some work with the MS DHTML control and I need to declare an object. The object/control is part of the DHTMLED.ocx but it is not found in the list of ActiveX controls I can drop on a form. When looking at the OCX in the Class Browser, I found that the name of the class is "DEInsertTableParam".
>
>I am trying to translate JavaScript and HTML coding into relevant VFP. The specific object and the code that instantiates it is below. If you are curious about what HTML page I'm translating in general, it is the "fulledit.htm" file that comes with the DHTML download.
>
>Here is the code. How would I translate this to VFP code?
>
>
>!-- DEInsertTableParam Object -->
>object ID="ObjTableInfo"
>CLASSID="clsid:47B0DFC7-B7A3-11D1-ADC5-006008A5848C" VIEWASTEXT>
>/object>
>
>
>I also tried to instantiate it by using the ADDOBJECT command, but it didn't work. I received an "invalid class string" error. Here is what I tried:
>
>
>ThisForm.AddObject('myctrl', 'olecontrol', 'DHTMLEDLib.DEInsertTableParam')
>
>
>Any help would be greatly appreciated!
>
>-Bri.
Have you tried searching for the clsid on the registry? (with regedit)
You can create automation objects from clsid's with CreateObjectEx(), but I don't believe it works with OCX's.
If you can find the ProgID for this CLSID you should be able to put that in the OLEClass parameter of AddObject().
HTH