Server Argument in COM object

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Server Argument in COM object

Post by artexercise »

Does anyone have any examples of exactly what goes in the server argument of the COM object?

My dilemma is this. My machine at work is on a network and not named localhost. I'm trying to launch MSWord using the COM object statement.

Code: Select all

$oCom = new COM("Word.Application") or die('argh!');
I get a dialog box that is titled OleMainThreadWndName:Apache.exe - Application Error and the contents are along the lines of The instruction as 'blah blah blah' referenced memory at 'blah blah'. The memory could not be "read"

And it creates an instance of WINWORD.EXE in the Task Manager of the system. Which of course I have to kill manually.

if I change the code to say,

Code: Select all

$oCom = new COM("Word.Application", "my_comp_name") or die('argh!');
my_comp_name withheld to protext the innocent

I get the follow error.

Warning: (null)(): Unable to obtain IDispatch interface for CLSID {000209FF-0000-0000-C000-000000000046}: Class not registered in path\comtest.php on line x
argh!


If I change the server argument to assoc.array of assoc.array like mentioned on php.net, I get the same thing. And finally, If I add in the port number that I'm running the Apache(1.3x) server through the browser just sits and spins and I have to do a hard reboot to reset the computer and try again.

I am on an NT system, I had it working before on an NT system but when I had it working, I was not using ports. I am currently using PHP v.4.3.10. I think I was using PHP v.4.3.1 before when COM was working as expected. Upgrading to PHP 5 is not possible at the moment.

JOE--
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Post by artexercise »

While I am unable to test the idea, I had finally found a message buried on phpbuilder.com that indicated I'd need to configure the application using dcomcnfg.exe.

I'm going to assume that this is part of the solution I am looking for but since I don't have appropriate rights to my machine at work I cannot test this.

So a partial solution. Thanks to anyone who scratched their head over this.

JOE--
Post Reply