Need to set up the php.ini file, find this line com.allow_dcom=true, put COM component support enabled
using PHP to invoke the OCX control, this is not a problem, but in reality, the use of Flash avoidance method is more general. The real use of OCX is not much, and the data is relatively small, from the Internet to see a successful example:
Actually call OCX or whatever the control file contains in
Include ("D:\wwwroot\Authen\Authen. OCX");
It then calls it with a COM function where the argument is with the file name . This is called by the form of the class name as important
$word = New COM ("Authen.cauthenctrl") or Die ("Unable to instanciate word");
It is so simple to complete the work of the PHP call Control ~ ~ ~ ~ ~ ~ ~ ~
I am an ActiveX control made with MFC,
Generates a authen. PHP inside references first
Include ("Authen. OCX 's physical path ");
$myCom = new COM ("Authen.cauthenctrl") or Die ("Unable to instanciate 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 instanciate word");
Print "Loaded Word, Version {$word->version}\n";
Before placing it
$word->visible = 1;
Open an empty document
$word->documents->add ();
Do something, whatever.
$word->selection->typetext ("This is a test ...");
$word->documents[1]->saveas ("Useless test.doc");
Close Word
$word->quit ();
Releasing objects
$word->release ();
$word = null;
How PHP invokes the OCX control