procedure testolenew()
   local oWord, oText
   begin sequence
      oWord = GetActiveObject( "Word.Application" )
   recover
      begin sequence
         oWord = CreateObject( "Word.Application" )
      recover
         alert( "ERROR! Word not avialable." )

   oWord = GetActiveObject( "Word.Application" )
   if oWord == NIL
      oWord = CreateObject( "Word.Application" )
      if oWord == NIL

Hi,


sorry Toninho, I've missed your mail with a problem. Przemek was right about OLE object creation code. Yes, I know I've implemented it in a incompatible way, but missing of some OLE server depends on installed software and is a normal situation. I found code:

  IF (oWord := GetActiveObject("Word.Application")) == NIL
    IF (oWord := CreateObject("Word.Application")) == NIL
      ? "Unable to create Word OLE object"
      RETURN .F.
    ENDIF
  ENDIF

much more elegant than all that begin/end sequences.

I see more messages about my OLE code: yes, s_oleerror should be made thread local, etc, etc. But I'm unable to fix it now and I'll be absent for 3 days. Thanks for cooperation, and sorry for not full/final ole code.


Regards,
Mindaugas




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

Reply via email to