On Tue, 15 Sep 2009, Enrico Maria Giordano wrote:

Hi,

> The following sample
> FUNCTION MAIN()
>    LOCAL oWord
>    oWord = WIN_OLECREATEOBJECT( "Word.Application" )

I have a question here.
In your previous example you used:
   oWord = CREATEOBJECT( "Word.Application" )
I'm interesting if using WIN_OLECREATEOBJECT() resolved the problem you
reported.
CREATEOBJECT() should be an wrapper to WIN_OLECREATEOBJECT()
and in such simple example both function should work without any
problems so if CREATEOBJECT() does not work for you then it may
suggest some problems with old libraries having old version of
CREATEOBJECT() which are linked with final application.
Do you use hbmk2 to link your examples?

>    oWord:Documents:Add()
>    ? oWord:ActiveDocument:StoryRanges[ 5 ]
>    oWord:Visible = .T.
>    RETURN NIL
> works fine using xHarbour while stops with
> Error BASE/1132  Bound error: array access
> using Harbour.
> Any ideas?

Objects created by WIN_OLECREATEOBJECT() do not overload operators
like [], +, -, *, /, %, ++, --. ^. \. ==. != which are overload in
TOLEAUTO class in xHarbour.
AFAIR Mindaugas was explaining on this list why he do not want to
overload [] operator but I do not remember exact reasons.
In the past we had similar to xHarbour TOleAuto class with such
operators. If it's important then we can try to reactivate some
parts of such functionality in our legacy.prg code but I would like
to hear Mindaugas opinion first.

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to