Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PHP accessing custom COM API

Posted on 2006-05-01
3
Medium Priority
?
191 Views
Last Modified: 2013-12-13
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?

0
Comment
Question by:jset_expert
3 Comments
 
LVL 9

Expert Comment

by:LinuxNubb
ID: 16589410
Does it die or do you get no object version?
0
 
LVL 1

Author Comment

by:jset_expert
ID: 16591761
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
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 900 total points
ID: 16603578
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

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month21 days, 5 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question