PHP and COM

Source: Internet
Author: User
Tags unsupported


PHP can operate COM and DCOM objects on Win32 platforms. 1. I have created a DLL to calculate something. Is there any way to run this DLL in PHP? 2. What does 'unsupported variant type: xxxx (0 XXXXX) 'mean? 3. Is it possible to operate on visual objects in PHP? 4. Can I store COM objects in the session? 5. How can I capture com errors? 6. How can I generate DLL files in PHP, just as I did in Perl? 7. What does 'unable to obtain idispatch interface for clsid {XXXXXXXX-XXXX-xxxxxxxxxxxx} 'mean? 8. How can I run COM objects from a remote server? 9. I got the message 'dcom is disabled in c: \ path... \ scriptname. php on line 6'. What should I do? 10. Can ActiveX objects be loaded on the PHP page? 11. Can I get a com runtime instance? 12. Is there a way to handle events sent from COM objects? 13. I encountered an error when calling a COM Object (with multiple interfaces) method. What should I do? 14. php can work on com. What about COM +? 15. Can PHP operate on COM objects? Can we use MTS to manage component resources and PHP?
1. I created a DLL to calculate something. Is there any way to run this DLL in PHP?
You cannot operate a simple DLL in PHP. If the dll contains a COM server and implements the idispatch interface, you can operate it.
2. What does 'unsupported variant type: xxxx (0 XXXXX) 'mean?
There are many variant types and their collections. the vast majority have been supported, but a few do not. arrays are not fully supported. Only one-dimensional arrays are supported. if you still find unsupported data types: Send a bug report (if no report is available) and provide as much information as possible.
3. Is it possible to operate on visual objects in PHP?
Usually, PHP is used to run scripts on Web server devices, but visual objects will never appear on the server desktop. If you use PHP as an application Program There is no limit to operating a visual object through COM as a script such as a PHP-GTK.
4. Can I store COM objects in the session?
No. com instances are considered resources. Therefore, they can only work in a single script program.
5. How can I capture com errors?
Currently, there are no other tools to track com errors. Apart from PhP (@, track_errors,...), we are considering a method to implement it.
6. Can I generate DLL files in PHP, just as I did in Perl?
No. Unfortunately, there is no such PHP tool.
7. What does 'unable to obtain idispatch interface for clsid {XXXXXXXX-XXXX-xxxxxxxxxxxx} 'mean?
There are many reasons for this error:

The clsid number is incorrect.

The DLL of COM cannot be found.

The component does not implement the idispatch Interface

8. How can I run COM objects from a remote server?
Just like running a local object, you just need to pass the remote IP address as the second parameter to the com constructor.
Make sure that com. allow_dcom = true in your php. ini file.
9. I got the message 'dcom is disabled in c: \ path... \ scriptname. php on line 6'. What should I do?
Edit the php. ini file and set com. allow_dcom = true.
10. Can ActiveX objects be loaded on the PHP page?
This should be unrelated to PhP. ActiveX is a client object called by HTML pages. It is not directly related to PHP scripts. Of course, there is no possibility of direct server interaction.
11. Can I get a com runtime instance? ?
Monikers can be used to implement this function. You can use the followingCode: That instance like shown:

$ word = new COM ("C: \ docs \ word.doc");
if no word instance is running, a new instance is created. otherwise, it returns its handle.
12. is there a way to handle events sent from COM objects?
NO.
13. I encountered an error when calling a COM Object (with multiple interfaces). What should I do?
the answer is simple and unsatisfactory. I am not very clear, but I think you don't have to do anything. if there are some situations and opinions about this, please let me (harald.radi@nme.at) know
14. PHP can work on com, so what about COM +?
COM + extends the COM framework to manage components through MTS and MSMQ. there is nothing special that PHP does not support.
15. PHP can operate on COM objects. Can we use MTS to manage component resources and PHP?
PHP cannot process transactions. in other words, if an error occurs, it still does not roll back. that is to say, you must manage the transaction by yourself by using the component objects that support transactions. (transaction-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.