Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTTrayIcon crashes on creation
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTTrayIcon crashes on creation

 Post Reply Post Reply
Author
Message
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Topic: CXTTrayIcon crashes on creation
    Posted: 09 February 2009 at 3:54pm
Hello all,

It seems that at least 2 users have reported (and I've narrowed it down using message boxes) that the following line crashes:

    if (!m_TrayIcon.Create(
        _T("My Program"), // Toolktip text
        this,                       // Parent window
        IDI_ICONTRAY,               // Icon resource ID
        IDR_MAIN_POPUP,             // Resource ID of popup menu
        IDR_RESTORE,                // Default menu item for popup menu
        false))                     // True if default menu item is located by position
    {
 
I cannot reproduce it on any of my test boxes, so cannot really see exactly what's going wrong.

Has anyone experienced somethig similar? Is there a fix?

Thanks!

   Dennis

// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2009 at 4:43pm
Hi,
 
Toolkit version ? Compiller ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2009 at 4:46pm
Yes, sorry - I've updated the signature, but it appears that existing messages are not updated with it.

It's MFC 12.1.1 compiled as a static link using VS2005.
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2009 at 4:47pm
Ah, it has updated now - I guess I didn't successfully update the profile before...
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2009 at 4:14am

Hi,

I don't see something in Create method that can crash :(   There was problem with some old 10.x release it was fixed - maybe these users use your old application ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2009 at 5:33am
No, they're using 12.1.1 for sure. I did find out one interesting thing - at least one of them somehow (third-party or whatever, I don't know yet fully) modified their Start menu and taskbar. Maybe that's the reason. The only potential problem in the Create method is the creation of the window, but I am also surprised why that would crash. I'm still investigating this with a user and hopefully I'll be able to recreate his modified environment and get that crash.
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2009 at 7:29am
Usually, when Create() fails it's due to a faulty doctemplate-string. Perhaps the resource is damaged?
 
Just a guess!
PokerMemento - http://www.pokermemento.com/
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2009 at 2:37pm
The resources should be fine, because it works for 99.9% of users :)

I have some more information from the user, I'll just quote him below:

"My StartKiller is a free utility that I got here: http://www.tordex.com/startkiller/ - I use the 32bit edition
The other tweak that I use is Emerge Desktop (http://emergedesktop.org/). This is a replacement windows shell. I implemented this to remove the task bar altogether.
I navigate my system with a tool called Launchy and some Auto Hot Key (AHK) scripts."

// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2009 at 2:43pm
And that brings up another question - is there a way to check whether the tray icon has been created? It doesn't appear to have m_hWnd or anything like that, so I'm not sure what to check.

Thanks!
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 February 2009 at 4:38am
Hi,
 
Think problem can be in "Emerge Desktop" he use. Think you return from Init Function if Create return False. guess you can ignore it instead.
 

    if (!m_TrayIcon.Create(
        _T("My Program"), // Toolktip text
        this,                       // Parent window
        IDI_ICONTRAY,               // Icon resource ID
        IDR_MAIN_POPUP,             // Resource ID of popup menu
        IDR_RESTORE,                // Default menu item for popup menu
        false))                     // True if default menu item is located by position
    {
   // Pity but don't return from function/
    }
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 11 February 2009 at 6:07am
Yes, I've changed my code to survive if the tray icon fails to create.
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.