FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBROWSE WITH KEY PRESSED CONTROL+C - BUG
Posts: 36
Joined: Sat Jun 19, 2010 10:09 AM

XBROWSE WITH KEY PRESSED CONTROL+C - BUG

Posted: Fri Jun 10, 2011 12:05 AM

if someone already noticed this and can give me a hint.

xbrowse to receive the focus and you press control + c it to the executable to run it with xHarbour even compiling the pulp samples.

now realized something compiling with buildh not to harbor the bug would be something that makes the xHarbour control + c to overthrow the app?
Would anyone be able to give me a hint thank use Fivewin 05.11 + xHarbour 1.21-9381 and bcc 582.

IT IS VERY STRANGE BECAUSE COMPILING WITH HARBOUR WORKS NORMAL, NOW WITH THE BUG xHarbour AND THE EXECUTABLE.

Posts: 36
Joined: Sat Jun 19, 2010 10:09 AM

Re: XBROWSE WITH KEY PRESSED CONTROL+C - BUG

Posted: Fri Jun 10, 2011 12:26 AM

unable to reach a conclusion, if built with xHarbour svn bug in the control + c, ie the rev. 6741, 6714 works well.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: XBROWSE WITH KEY PRESSED CONTROL+C - BUG

Posted: Fri Jun 10, 2011 04:32 AM
When Ctrl-C is pressed, XBrowse tries to load Excel, if not done earlier. This is done through a function ExcelObj() in the module \fwh\source\function\olefuncs.prg.

The code to load Excel or other office applciation in olefuncs.prg is this:
Code (fw): Select all Collapse
   TRY
      oObj  := GetActiveObject( cApp )
   CATCH
      TRY
         oObj  := CreateObject( cApp )
      CATCH
      END
   END

It has been reported by all users of xHarbour commerical and users of some versions of free xHarbour that their programs were hanging while executing "GetActiveObject( cApp )".

It was recommended to them to replace the above code with :
Code (fw): Select all Collapse
   TRY
      oObj  := TOleAuto():New( cApp )
   CATCH
   END

This solution appeared to have solved their problems.

In some other cases of xHarbour users of some versions, when the excel object is loaded ( in either version of the above code ) the excel application was exiting with a Windows error code. I experienced this personally too.

Logically it is difficult to say why TOleAuto():New( cApp ) should give rise to such an error and that too only with some versions of xHarbour.

However changing all declarations of variables inside ExcelObj(), WordObj(), etc as "static" instead of "local" resolved the issue, though I can not explain this logically.

You may try tweaking with olefuncs.prg and help us with your feedback.

Latest build of 11.05 released on 6th June resolved this problem atleast in my case.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion