FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Strange ttray error
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Strange ttray error
Posted: Tue Aug 19, 2008 11:18 AM
Hello all,

from time to time I receive a strange error log on class ttray.

  DEFINE WINDOW ::oWnd STYLE NOR( WS_POPUP, WS_DISABLED ) FROM 0,0 TO 0,0 OF oWnd
  ACTIVATE WINDOW ::oWnd ON INIT ::oWnd:Hide()


The second line crashes the program with:
class NIL has no exported method :Hide()

How could that happen ?

Hi,
Davide
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Strange ttray error
Posted: Tue Aug 19, 2008 11:33 PM

Davide,

Sometimes these strange ones are timing related. You might try changing the TTray code to add a sysrefresh() like this:

DEFINE WINDOW ::oWnd STYLE NOR( WS_POPUP, WS_DISABLED ) FROM 0,0 TO 0,0 OF oWnd
ACTIVATE WINDOW ::oWnd
sysrefresh()
::oWnd:Hide()

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Strange ttray error
Posted: Tue Aug 19, 2008 11:52 PM

James,

> Sometimes these strange ones are timing related.

thank you. You gave me a good idea.

In effect this happens when oTray:lSuccess=.f. and I repaint the tray icon with a New(). Perhaps I just need to delay the new tray creation in these rare cases.

Thank you,
Davide

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Strange ttray error
Posted: Wed Aug 20, 2008 05:15 AM

Davide,

>In effect this happens when oTray:lSuccess=.f. and I repaint the tray icon with a New(). Perhaps I just need to delay the new tray creation in these rare cases.

Well, I'm confused. I don't see a lSuccess var in the TTray class. Are you using a revised version, or a version later than 8.05?

Also, you should never call the New() method of any object more than once. If you want to repaint the tray icon why aren't you just using the Refresh() method?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion