PHP accessing custom COM API

Hi,

I am new to PHP so please bare with me.

I am trying to access a COM object using PHP. I have accessed this Object in VBA successfully using;

Set the_object = CreateObject("PrismWin.Connect")
MsgBox "Sucessfully loaded PWC object" & vbCrLf & "version: " & the_object.get_version & vbCrLf
' LOGIN
if (the_object.login(sPrismPath, sClient, sUser, sPassword, PWC_Id) = 0) Then
MsgBox "Failed to login"
else
MsgBox "Successfully logged in"
end if

' LOGOUT
the_object.logout PWC_Id
MsgBox "logged out"



I have tried to use;

com_load_typelib("PrismWin.Connect");                  
$the_object = new COM("PrismWin.Connect") or die("Cannot start PWC for you");
echo "Loaded PWC, version {$the_object->get_version}\n";

with no success. Can anyone help with this?

LVL 1
jset_expertAsked:
Who is Participating?
 
Richard QuadlingConnect With a Mentor Senior Software DeveloperCommented:
Just to confirm, you can run the VBA code you have on the webserver and it works?

Remember that running the code on YOUR pc is not a guarantee that it will work on the server. You will need to have the COM server installed on the webserver.

Of course, if your pc IS the webserver, then this is a moot point.

Personally, I suspect that IIS needs to be configured in some way to allow you to use the COM server.

Do you have MS Word installed on the webserver (if it is a real webserver, then I doubt you do!), then try the scripts in my user notes here ...

http://www.php.net/manual/en/function.com-load-typelib.php#29832 (PHP COM & MS Word example.)




0
 
LinuxNubbCommented:
Does it die or do you get no object version?
0
 
jset_expertAuthor Commented:
I get no version.

Oh, I also forgot to mention that I am using PHP4 on a IIS webserver, I can port it over to Apache if there are any known issues with IIS.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.