Re: Use of OLE constants in PHP
- From: gosha bine <stereofrog@xxxxxxxxx>
- Date: Mon, 30 Jul 2007 13:43:51 +0200
On 30.07.2007 11:23 Patrick wrote:
gosha bine a écrit :
What does it say if you do
com_load_typelib("Word.Application");
print_r(preg_grep('/^wd/',
array_keys(get_defined_constants())));
The first time I execute it, I got :
Array
(
[1032] => wdNoMailSystem
[1033] => wdMAPI
[1034] => wdPowerTalk
[1035] => wdMAPIandPowerTalk
[1036] => wdNormalTemplate
[1037] => wdGlobalTemplate
[1038] => wdAttachedTemplate
[1039] => wdContinueDisabled
[1040] => wdResetList
[1041] => wdContinueList
[1042] => wdIMEModeNoControl
.....
)
and I have no error in Word but from the second execution, I got only
Array
(
)
and Word raise the exception.
I tried your code on several different php/xp/office combinations and got everything possible from php exceptions to system crashes. The code works fine if I remove com_load_typelib and replace wd... constants with numeric values. This makes me think 'com_load_typelib' is somewhat unstable and I'd suggest you just get rid of it. Define constants you need directly in php (you can pull constant definitions out of the OLB file using oleview or similar tool).
--
gosha bine
makrell ~ http://www.tagarga.com/blok/makrell
php done right ;) http://code.google.com/p/pihipi
.
- Follow-Ups:
- Re: Use of OLE constants in PHP
- From: Patrick
- Re: Use of OLE constants in PHP
- References:
- Use of OLE constants in PHP
- From: Patrick
- Re: Use of OLE constants in PHP
- From: gosha bine
- Re: Use of OLE constants in PHP
- From: Patrick
- Use of OLE constants in PHP
- Prev by Date: Re: Changes for PHP5 ?
- Next by Date: Re: mysql command line client
- Previous by thread: Re: Use of OLE constants in PHP
- Next by thread: Re: Use of OLE constants in PHP
- Index(es):
Relevant Pages
|