The Geek Forum

Main Forums => Homework Help => Topic started by: Probie on October 19, 2009, 10:25:48 AM

Title: HI FIRST POST - (I am a total n00b but I love geeks...can someone help me?)
Post by: Probie on October 19, 2009, 10:25:48 AM

JUST KIDDING!  :-D

Hey programmers of the world... My brain is melting! So I'm using WinAPI and a class that creates systray icons. The systray icon example I have uses MFC (I could right everything I know about MFC on my thumb) and I am trying to mold it into my winapi app (limited knowledge also!). So, so far I have created the recourse ico thingi, and it in turn auto generated the resource.h file.

My icon loading code looks like this :

HICON trayIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));

But has weird contents like this :

trayIcon = 0x01a20557 {unused=??? }
unused = CXX0030: Error: expression cannot be evaluated

similarly when I pass the hwnd obj to the system tray class its contents is as above ^

then when we go into the createSystemTrayIcon() method and the

m_hParentWnd = parent;

window is assigned...it all goes tits up!

Unhandled exception at 0x00415799 in blueline.exe: 0xC0000005: Access violation writing location 0x00000008.


So what do you think? Is there an ovbious mistake here. I'm not sure who else programs, so this is mainly directed towards ivan I guess. Any help would be really appreciated.

Here, someone else has the same issue...but no one responded:

http://thewinforums.com/topic/52955-create-window-problem/ (http://thewinforums.com/topic/52955-create-window-problem/)
Title: Re: HI FIRST POST - (I am a total n00b but I love geeks...can someone help me?)
Post by: BizB on October 19, 2009, 11:27:43 AM
Mmmmm tits
Title: Re: HI FIRST POST - (I am a total n00b but I love geeks...can someone help me?)
Post by: ivan on October 19, 2009, 11:53:46 AM
I won't pretend to know whether your code is right, but the "CXX0030: Error: expression cannot be evaluated" message usually has to do with memory issues, like reading past an array's upper bound, or accessing unallocated memory, or even corrupted memory. The problem is probably not in your code -- your code is being handed something it can't cope with. I'm guessing the problem is in the ico thingie or the resource.h file -- try deleting and recreating those. You may have to dig into MFC somewhat.
Title: Re: HI FIRST POST - (I am a total n00b but I love geeks...can someone help me?)
Post by: Probie on October 19, 2009, 12:08:27 PM

I just ran the original piece of code a few times and it turns out the handle to the window is a little tempuremental. It occassionally has a value like unused=42342, but mostly unused=????. Which is weird. The original piece of code was written in visual studio 6 and i am using 8. So I'm wondering if that has anything to do with it. How if there is just something wrong with the window class. :(

Thanks for the advise, I keep an eye out for memory corruption.
Title: Re: HI FIRST POST - (I am a total n00b but I love geeks...can someone help me?)
Post by: jeee on October 19, 2009, 02:15:28 PM
Can you lay next to me and whisper those two posts in my ear? It's the ultimate geek porn fantasy :-D