PHP calls the OCX control

Source: Internet
Author: User
You need to set the php. ini file, find this line of com. allow_dcomtrue, and enable the com component to use PHP to call the OCX control. This is not a problem, but in reality, the flash method is more common. There are not many actually used ocx, and there are few materials. We can see a successful example on the Internet: in fact, calling the OCX file is the same as the DLL file.

Php. INI file, find this line of com. allow_dcom = true: enabling the com component support using PHP to call the OCX control is not a problem, but the flash method is more common in reality. There are not many actually used ocx, and there are few materials. We can see a successful example on the Internet: in fact, calling the OCX file is the same as the DLL file.

You need to set the php. ini file, find this line of com. allow_dcom = true, and enable the com component support.

Using PHP to call the OCX control is not a problem, but the flash method is more common in reality. There are not many actually used ocx, and there are few materials. We can see a successful example on the Internet:

Actually called OCXFiles are the same as DLL files.

First, set the target DLL orOCXOr what control files are included

Include ("D: \ wwwroot \ Authen.Ocx");

Then, use the COM function to call it. The parameter is a file name..It is important to call the class name.

$ Word = new COM ("Authen. CAuthenCtrl") or die ("Unable to instancate Word ");

This can be done simply.PHPCall controls ~~~ Haha ~~~


Even ActiveX controls made with MFC,
An Authen is generated.OcxFile,
If you wantPHPFirst
Include ("Authen.OcxPhysical path ");
$ MyCom = new COM ("Authen. CAuthenCtrl") or die ("Unable to instancate Word ");
Authen is the file name.
CAuthenCtrl is the class name

Source: http://blog.chinaunix.net/uid-22414998-id-113455.html


Found from the manual
// Start word
$ Word = new COM ("word. application") or die ("Unable to instancate Word ");
Print "Loaded Word, version {$ word-> Version} \ n ";

// Set it to the front
$ Word-> Visible = 1;

// Open an empty document
$ Word-> Documents-> Add ();

// Do whatever you want
$ Word-> Selection-> TypeText ("This is a test ...");
$ Word-> Documents [1]-> SaveAs ("Useless test.doc ");

// Close the word
$ Word-> Quit ();

// Release the object
$ Word-> Release ();
$ Word = null;

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.