You are here: Re: Use of OLE constants in PHP « PHP Programming Language « IT news, forums, messages
Re: Use of OLE constants in PHP

Posted by Patrick on 07/30/07 12:17

gosha bine a écrit :
> 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).
>
>

Thanks for your help.

I have replaced the constants by their numeric value and all is ok now.

Patrick

 

Navigation:

[Reply to this 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

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