Accessing activeX control from other layer

I want to call a method from an activeX control from another layer object. A script attached of the activeX control does list me the methods, but externally it says unknown method.

var activeX = DesktopX.Object("myUsedActiveX");

if(activeX)
{
Script.MsgBox(activeX.name);
//activeX.Control.DoCommand(cmd); // doesnt work
activeX.DoCommand(cmd); // doesnt work either
}
else
Script.MsgBox("activeX not found"); // thats not called, i get that object
2,289 views 2 replies
Reply #1 Top

If you don't receive a response to your thread, you might want to try posting in the OS Customization forum. Anything user created is unfortunately not supported.

-Mike
[Stardock Support]

Reply #2 Top
If you're trying to access a method or property of the ActiveX control, then use:

DesktopX.ScriptObject("myUsedActiveX").Control.Dosomething(cmd)

If you're trying to use a sub or function in the script, then it's:

DesktopX.ScriptObject("myUsedActiveX").Dosomething(cmd)

To make sure the object is there use:

If DesktopX.IsObject("myUsedActiveX") Then


End If

You could probably make your code work by using:

activeX = DesktopX.ScriptObject("myUsedActiveX")

but I haven't used that form myself.