RE: COM on remote machine + MapPoint COM question?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm playing around with COM right now doing things with PHP and
MapPoint.  I got the feeling that COM was something that had to work on
the local machine because you needed the COM information in your
registry to tell the computer what application to run.  That is, PHP
says "Open COM connection to MapPoint", the user's computer looks at the
listing of COM apps and when it finds MapPoint it knows what EXE to run.
Unlike DDE where you need the application running and listening for DDE
input.


After doing a little research, I think I figured out that what you want
is DCOM if you want to do a COM call to a remote PC.  I don't have time
to do the full research on what it takes to set up a DCOM server, but it
sounds like it's possible to do what you're talking about.

Couple of things I noticed:

1. Check out the "COM support functions for Windows" at:
http://www.php.net/manual/en/ref.com.php
   It says that the default PHP.INI setting is com.allow_dcom = FALSE
(looking at PHP.INI I see that it's commented out on mine)

2. When instantiating a new COM object, you CAN give it a server name to
connect to (for DCOM):
	string COM::COM ( string module_name [, string server_name [,
int codepage]])
	http://www.php.net/manual/en/class.com.php


Hope this helps.  If you have questions about working with the objects,
methods and properties, I might be able to help you out a little.   I've
never really worked with objects and such before (being largely
self-taught programming-wise.. Never learned that fancy stuff in school.
Heh) and all the code samples I found were either VERY basic (PHP ->
COM) or only semi-helpful (Microsoft VBA code examples).  But I think I
figured it all out now.


Now if someone could tell me why the "StartTime" property on a Direction
Object in MapPoint ALWAYS returns a "-1" instead of a time value, I'd
REALLY appreciate it.   :)  That's the only thing about MapPoint so far
that I havn't been able to figure out.   I want to use it to show an
icon where a truck is en route between an origin and destination given
it's departure time and the current time of day.

Hope some of this helps, Marc!  Good luck!

-TG




> -----Original Message-----
> From: M.Staiger [mailto:mstaiger@xxxxxxxxxxxxxxxxxxxxxxxx] 
> Sent: Thursday, April 22, 2004 8:12 AM
> To: php-windows@xxxxxxxxxxxxx
> Subject:  COM on remote machine
> 
> Hello NG,
> 
> Imagine that you have one machine running iis with php and 
> want to call a
> COM-Server (e.g. Word) on a remote machine.Would this be 
> possible? How would
> it look like, if this is the call for the local machine : $word = new
> COM("word.application");
> 
> Thanks,
> Marc

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux