PHP and com_php Tutorials

Source: Internet
Author: User
Tags unsupported
PHP can manipulate COM and DCOM object 1 under the Win32 platform. I created a DLL to calculate something. Is there any way to run this DLL under PHP? 2. What does ' unsupported variant type:xxxx (0xxxxx) ' mean? 3. Is it possible to manipulate visual objects in PHP? 4. Can I store COM objects in the session? 5. How do I catch a COM error? 6. How do I generate DLL files in PHP, just like I did in Perl? 7. What does ' unable to obtain IDispatch interface for CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} ' mean? 8. How do I run a COM object from a remote server? 9. I get the message: ' DCOM is disabled in C:\path...\scriptname.php on line 6 ', what should I do? 10. Can I load ActiveX objects on my php page? 11. Can I get an instance of a COM runtime? 12. Is there a way to handle events sent from COM objects? 13. I have an error when calling a method of a COM object (with multiple interfaces). What should I do? PHP can work with COM, what about COM +? PHP can manipulate COM objects, can we envision managing PHP through the MTS management component resources?
1. I created a DLL to calculate something. Is there any way to run this DLL under PHP?
You cannot 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 a few are not. Arrays are not fully supported, only one-dimensional arrays are supported. If you also find unsupported data types: Please send bug reports (if not yet reported) and provide as much information as possible.
3. Is it possible to manipulate visual objects in PHP?
It's usually possible. But PHP is mostly used as a script to run under a Web server device, and a 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 the visualization of objects through COM operations.
4. Can I store COM objects in the session?
No, you can't. A COM instance is considered a resource. Therefore, they can only work in a single scripting program.
5. How do I catch a COM error?
There are currently no other tools that can track COM errors, except 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 ' 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.
Unable to find the DLL where COM is located
Component does not implement IDispatch interface

8. How do I run a COM object from a remote server?
Just like you run a local object. You just need to pass the remote IP address as the second parameter to the COM constructor.
Also confirm that your php.ini file is com.allow_dcom=true.
9. I get the message: ' 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.
10. Can I load ActiveX objects on my php page?
This should be unrelated to 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 possibility of direct server-side interaction.
11. Can I get an instance of a COM runtime??
This function can be achieved with monikers. You want multiple references to the same instance of Word, you can use the following code: That's instance like shown: $word = new COM ("C:\docs\word.doc");
If no instance of Word is running, it creates a new instance. Otherwise, it returns a handle to it.
12. Is there a way to handle events sent from COM objects?
Not yet.
13. I have an error when calling a method of a COM object (with multiple interfaces). What should I do?
The answer is so simple that people are not satisfied. I'm not too sure, but I don't think you need to do anything. If there are some situations and opinions about this, please let me (harald.radi@nme.at) know:)
PHP can work with COM, what about COM +?
COM + extends the use of the COM framework to manage components through MTS and MSMQ. Nothing special. PHP is not supported.
PHP can manipulate COM objects, can we envision managing PHP through the MTS management component resources?
PHP itself is not able to process transactions. This means that if an error occurs, it will still not roll back. Even with component objects that support trading, you have to manage your own transactions. (Trading-transactions)

http://www.bkjia.com/PHPjc/314069.html www.bkjia.com true http://www.bkjia.com/PHPjc/314069.html techarticle PHP can manipulate COM and DCOM objects under the Win32 platform 1. I created a DLL to calculate something. Is there any way to run this DLL under PHP? 2. ' Unsupported Variant ...

  • Related Article

    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.