CXTTrayIcon crashes on creation |
Post Reply |
Author | |
dennisV
Senior Member Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
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) |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Toolkit version ? Compiller ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
dennisV
Senior Member Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
|
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) |
|
dennisV
Senior Member Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
|
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) |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
dennisV
Senior Member Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
|
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) |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
dennisV
Senior Member Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
|
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) |
|
dennisV
Senior Member Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
|
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) |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
dennisV
Senior Member Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
Post Options
Thanks(0)
|
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) |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |