COM in PHP

HouseBot Plugin Development Discussions.
Post Reply
Djony1987
Member
Posts: 7
Joined: Thu Jul 02, 2009 1:57 pm
Location: Russia, Ekaterinburg

COM in PHP

Post 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!
ScottBot
Site Admin
Posts: 2786
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: COM in PHP

Post 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.
Scott
Djony1987
Member
Posts: 7
Joined: Thu Jul 02, 2009 1:57 pm
Location: Russia, Ekaterinburg

Re: COM in PHP

Post by Djony1987 »

Hi ScottBot,

There is a web example in ExternalComControl...what should i do to make this sample work?
Thank!
ScottBot
Site Admin
Posts: 2786
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: COM in PHP

Post 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.
Scott
Djony1987
Member
Posts: 7
Joined: Thu Jul 02, 2009 1:57 pm
Location: Russia, Ekaterinburg

Re: COM in PHP

Post 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?
ScottBot
Site Admin
Posts: 2786
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: COM in PHP

Post 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.
Scott
Djony1987
Member
Posts: 7
Joined: Thu Jul 02, 2009 1:57 pm
Location: Russia, Ekaterinburg

Re: COM in PHP

Post by Djony1987 »

ScottBot, Thank! With IIS web_sample work.
Post Reply