Strange ttray error

Strange ttray error

Postby Davide » Tue Aug 19, 2008 11:18 am

Hello all,

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

Code: Select all  Expand view  RUN
  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
Davide
 
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

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

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

Postby James Bott » Wed Aug 20, 2008 5: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 96 guests