Reply to Re: Use of OLE constants in PHP

Your name:

Reply:


Posted by gosha bine on 07/30/07 11:43

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация