Print Page | Close Window

CXTTrayIcon crashes on creation

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=13368
Printed Date: 20 May 2024 at 10:07pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTTrayIcon crashes on creation
Posted By: dennisV
Subject: CXTTrayIcon crashes on creation
Date 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)



Replies:
Posted By: Oleg
Date Posted: 09 February 2009 at 4:43pm
Hi,
 
Toolkit version ? Compiller ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: dennisV
Date 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)


Posted By: dennisV
Date 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)


Posted By: Oleg
Date 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


Posted By: dennisV
Date 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)


Posted By: znakeeye
Date 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/


Posted By: dennisV
Date 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/ - http://www.tordex.com/startkiller/ - I use the 32bit edition
The other tweak that I use is Emerge Desktop ( http://emergedesktop.org/ - 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)


Posted By: dennisV
Date 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)


Posted By: Oleg
Date 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


Posted By: dennisV
Date 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)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net