Strange ttray error

Post Reply
Davide
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Strange ttray error

Post by Davide »

Hello all,

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

Code: Select all | Expand

  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
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
Davide
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Post by Davide »

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
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
Post Reply