note 34635 added to class.com
| From: | alexs81 at libero dot it | Date: | Fri, 01 Aug 2003 20:39:17 +0000 |
| Subject: | note 34635 added to class.com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-53164@lists.php.net to get a copy of this message | ||
Little but also unuseful example to use COM in real world
this little example works...
I was searching how to made a printing function of TXT files but notepad hasn't a COM
connection
<?
$browser = new COM("internetexplorer.application"); //COM commection with IE (always
present in windows)
$browser->Navigate("c:\\php\\prova.txt");//Open a file (even a TXT)
while ($browser->ReadyState!=4);//Waiting for the browser to finish rendering the DOC
// trying to hide IE Icon and Window
$browser->Width=0;
$browser->Height=0;
$browser->resizable=false;
// Printing...
$browser->ExecWB(6,2,null,null);
$browser->Visible = false;
sleep(1); //if I don't wait a sec IE tells me I've made sometihng wrong, i wiat a sec all
right... another Xfiles of IE or someone knows why ???
$browser->quit(); //quitting and freeing memory... maybe useful...
?>
Notice that COM Funciton can be called directly and arguments can be passed as a local function
I tried com_invoke.... but no way to make it works
----
Manual Page -- http://www.php.net/manual/en/class.com.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34635
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34635&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34635&report=yes