Hi,

Przemyslaw Czerpak wrote:
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.

I also thought it should work with CreateObject(), but I know WIN_OLECREATEOBJECT() works, so, I suggested a tested solution.

We had some compatibility layer in hbwin/legacy.prg. Please look into it and fix it if it is necessary.


   ? oWord:ActiveDocument:StoryRanges[ 5 ]
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.

Well, I do not remember the exact reasons also :), it's something related to assign operator and +=, -=, etc. operators. You can find an arguments in mailing list archive. The best way is to download gzip'ed archive from http://lists.harbour-project.org/pipermail/harbour/ and do multi file search.

But I know that, if :StoryRanges is a real OLE collection, when :StoryRanges:Item(5) should work for sure in both xHarbour and Harbour, because :Item() is OLE method defined for all collections.


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

Reply via email to