Sign in to follow this  
Followers 0
cp1983

Com Return Variable

4 posts in this topic

Hi,

I'm trying to use a com object to get some information from a program that is running. I am able to use AutoIt to control the program via the com object.

Dim $PlotManObject = ObjCreate("Pmhost.PlotMgrCtrl")
$PlotManObject.SendCommand(0,"AddGroup", "Test123", "D:\Header.jhf", " ", " ", " ", " ", " ", 1308265)

However to get the information from the program I have to use:

Dim $return2
Dim $PlotManObject = ObjCreate("Pmhost.PlotMgrCtrl")
$PlotManObject.GetStatus(0,"GetProjectTreeText","1;1","",$return2,1308265)
MsgBox(0,"",$return2)

This should give me a string in $return2

It works i VBA with this code:

Set pmc = CreateObject("Pmhost.PlotMgrCtrl.1")
Dim rResult As Variant
Dim lRet As Long
pmc.GetStatus 0, "GetProjectTreeText", "1;1", "", rResult, VarPtr(lRet)
MsgBox rResult

I just can't figure out whay AutoIt won't return the string for me? Does anyone know?

Regards,

Christian

Share this post


Link to post
Share on other sites



AutoIt doesn't work with reference parameters in COM yet. It's a problem that's been around a while, sorry.

Share this post


Link to post
Share on other sites

Hi,

Thanks for the reply.

I will then write a COM for my COM to handle it :)

Regards,

Christian

Share this post


Link to post
Share on other sites

Good luck. Just make sure your COM functions don't have reference parameters.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0