OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: stephan_35 on November 20, 2009, 03:38:45 AM

Title: Example of using ActiveX inside OpenDCL ?
Post by: stephan_35 on November 20, 2009, 03:38:45 AM
Hello,

I would like to know if it's easy to use activeX inside openDCL, and if anybody already use these ???

Thanks for help.
Best regards.
Title: Re: Example of using ActiveX inside OpenDCL ?
Post by: Fred Tomke on November 20, 2009, 03:47:54 AM
Hi Stepjan, you mean an ActiveX control? It is as easy as you can trust that the user has installed it. I have used it at my ObjectDCL dialogs. But some admins did not install the controls I needed or the control was unregistered. Then error messages came up and I gave up.

Fred
Title: Re: Example of using ActiveX inside OpenDCL ?
Post by: stephan_35 on November 20, 2009, 04:00:40 AM
Hi,
By the merest chance, would you use the ActiveX control treeview?
I'm having some trouble with setting objects OpenDCL, and I wanted to attempt the side of ActiveX ...

I found this :
http://www.opendcl.com/forum/index.php?topic=149.msg829#msg829 (http://www.opendcl.com/forum/index.php?topic=149.msg829#msg829)
Quote
(dcl_AxControl_DoMethod <tree-control> "Add" <optional Relative> <optional Relationship> <optional Key> <optional Text> <optional Image> <optional SelectedImage>)

The arguments are more fully described at:
http://msdn2.microsoft.com/en-us/library/aa443386(VS.60).aspx (http://msdn2.microsoft.com/en-us/library/aa443386(VS.60).aspx)

To test the tree control, I tried the following:

(setq Nodes (dcl_AxControl_GetProperty <tree-control> "Nodes"))
; now Nodes is an OLE Object, and we use (dcl_AxObject_*) syntax
(Setq NewNode (dcl_AxObject_DoMethod Nodes "Add"))
; NewNode is also an OLE Object
(dcl_AxObject_SetProperty NewNode "Text" "MyNewTreeItem")
; this should work, but the call into the tree control fails with a COM error
(setq text (dcl_AxObject_GetProperty Node "Text")) ;this works fine
(dcl_AxObject_Close NewNode) ;release the node
(dcl_AxObject-Close Nodes) ;release the nodes collection

I'm not sure why the call to set the 'Text' property fails, but I will investigate this. The code above should work, and at least it can demonstrate the basic steps.
Thank you for your help
Best regards
Title: Re: Example of using ActiveX inside OpenDCL ?
Post by: owenwengerd on November 20, 2009, 08:35:01 AM
If you encounter any problems with the ActiveX tree control, post them here.