Page 1 of 1

COM in PHP

Posted: Thu Jul 02, 2009 2:11 pm
by Djony1987
Hi,
I try to control HB externaly using PHP with COM object. I write:

$Obj=new COM("HBControlMod.HBControl");
$szRsp=$Obj->Connect(80, "127.0.0.1", "pwd");
It's correct?

(echo $szRsp; // "OK")

How i can call additional methods? (for example - GetPropertyValue, SetPropertyValue)
Thank!

Re: COM in PHP

Posted: Thu Jul 02, 2009 4:42 pm
by ScottBot
I've never used COM within PHP, but I would think that you should be able to just call the functions from your $Obj variable (assuming that the connect code you have works). If you look in the online help for the external control device, it will give the syntax of all of the methods available.

You may also be able to use PHP socket functions to connect directly to the external control plugin and then use the ASCII protocol.

Re: COM in PHP

Posted: Tue Jul 07, 2009 3:09 am
by Djony1987
Hi ScottBot,

There is a web example in ExternalComControl...what should i do to make this sample work?
Thank!

Re: COM in PHP

Posted: Tue Jul 07, 2009 8:48 am
by ScottBot
Check out the "COM Control Object" section of the External Control online help. Further down the page, it explains what you need to do to run the ASP sample. If that doesn't cover it and you have more questions, just let me know.

Re: COM in PHP

Posted: Wed Jul 08, 2009 2:55 pm
by Djony1987
Hi,

I have Apache installing on my PC, i copy folder (web_sample) to web server folder (localhost) and register HBControlMod.dll. The web_sample doesn't work.
What could be the problem?

Re: COM in PHP

Posted: Wed Jul 08, 2009 3:35 pm
by ScottBot
With IIS it should just work. For apache, you will need probably need to install mod_asp or something to get it working. I've never ran it on apache, so I can't say for sure.

Re: COM in PHP

Posted: Sat Jul 11, 2009 8:18 am
by Djony1987
ScottBot, Thank! With IIS web_sample work.