PHP and COM

Source: Internet
Author: User
Tags arrays html page implement ini interface php and php script unsupported
PHP can operate COM and DCOM object 1 under the Win32 platform. I created a DLL to compute something. Is there any way to run this DLL in PHP? 2. What does ' unsupported variant type:xxxx (0XXXXX) mean? 3. Is it possible to manipulate visual objects in PHP? 4. Can I put COM objects into session? 5. How do I capture COM errors? 6. How do I generate DLL files in PHP, just like I did in Perl? 7. What does the ' unable to obtain IDispatch interface for CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} ' mean? 8. How do I run COM objects from a remote server? 9. I get the message: ' The DCOM is disabled in C:\path...\scriptname.php on line 6 ', what should I do? 10. Can I load ActiveX objects in a PHP page? 11. Can I get an example of a COM runtime? 12. Is there a way to handle events sent from COM objects? 13. I encountered an error while calling a method of a COM object (with multiple interfaces). What should I do? PHP can COM work, then COM +? PHP can manipulate COM objects, can we imagine managing the component resources through MTS to manage PHP?
1. I created a DLL to compute something. Is there any way to run this DLL in PHP?

You can't operate a simple DLL in PHP. If the DLL contains a COM server and implements the IDispatch interface, you can manipulate it.
2. what does ' unsupported variant type:xxxx (0XXXXX) mean?

There are many VARIANT types and their collections. The vast majority have been supported, but there are a few who do not support it. Arrays are not fully supported, and only one-dimensional arrays are supported. If you also find unsupported data types: Please send bug reports (if not reported) and provide as much information as possible.
3. is it possible to manipulate visual objects in PHP?

is usually possible. But PHP is mostly used as a script to run under a Web server device, and the visual object never appears on the server desktop. If you use PHP as an application script such as PHP-GTK, there is no limit to visualizing objects through COM operations.
4. can I put COM objects into session?

No, you can't. COM instances are considered to be resources. So they work only in a single scripting program.
5. How do I capture COM errors?

No other tools are currently available to track COM errors, except for PHP self (@, track_errors, ...), and we are considering a way to implement it.
6. can I generate DLL files in PHP, just like I did in Perl?

No, you can't. Unfortunately, there is no such PHP tool.
7. What does the ' unable to obtain IDispatch interface for CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} ' mean?

There are many reasons for this error:

    • The CLSID number is wrong.

    • The DLL where COM resides cannot be found

    • Component does not implement IDispatch interface


8. How do I run COM objects from a remote server?

As if you were running a local object. You just need to pass the remote IP address as the second parameter to the COM constructor.
Also make sure that your php.ini file is com.allow_dcom=true.
9. I get the message: ' The DCOM is disabled in C:\path...\scriptname.php on line 6 ', what should I do?

Edit the php.ini file and set the Com.allow_dcom=true.
can I load ActiveX objects on a PHP page?

This should have nothing to do with PHP. ActiveX is a client object that is called by an HTML page. is not directly related to the PHP script. Of course, there is no direct server-side interaction possible.
can you get a COM run-time instance??

This function can be achieved with monikers. You want multiple references to the same instance of Word, you can use the following code: that instance like shown:
$word = new COM ("C:\docs\word.doc");

If no instance of Word is running, it creates a new instance. Otherwise, it will return its handle.
is there a way to handle events sent from COM objects?

Not yet.
I encountered an error while calling a method of a COM object (with multiple interfaces). What should I do?

The answer is simple enough to make people dissatisfied. I'm not quite sure, but I don't think you need to do anything. Please let me know if there are any harald.radi@nme.at about this:)
PHP can com work, then COM +?

COM + has expanded the framework for the use of MTS and MSMQ management components. There's nothing special. PHP is not supported.
PHP can manipulate COM objects, can we imagine managing the component resources through MTS to manage PHP?

PHP itself cannot handle transactions. This means that if there is an error, it still does not roll back. Even with component objects that support trading, you have to manage your transactions yourself. (Deal-transactions)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.