The Geek Forum

  • April 27, 2024, 02:30:20 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Due to the prolific nature of these forums, poster aggression is advised.

*

Recent Forum Posts

Shout Box

Members
Stats
  • Total Posts: 129551
  • Total Topics: 7148
  • Online Today: 141
  • Online Ever: 1013
  • (January 12, 2023, 01:18:11 AM)

Author Topic: HI FIRST POST - (I am a total n00b but I love geeks...can someone help me?)  (Read 2215 times)

Probie

  • Professional Blogger
  • ***
  • Coolio Points: +223/-5
  • Offline Offline
  • Posts: 644
  • The natural nap catalyst
    • View Profile
    • SoggyBlog


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/
Logged
// ------- Probie ------- //
// ----------------------- //
// --- T3H GEEKERY --- //
// ----------------------- //
www.niccisixx.com - I can put this here, because I'm awesome.

BizB

  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +439/-15
  • Offline Offline
  • Gender: Male
  • Posts: 4324
  • Keep making circles
    • View Profile

Mmmmm tits
Logged
Without me, it's just 'aweso'.

ivan

  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +499/-50
  • Offline Offline
  • Posts: 4929
  • Not a Mod, nor a Rocker. A Mocker.
    • View Profile

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.
Logged
"I TYPE 120 WORDS PER MINUTE, BUT IT'S IN MY OWN LANGUAGE!"  -Detta

xolik: WHERE IS OBAMA'S GIFT CERTIFICATE?
Demosthenes: Is that from the gifters movement?


Detta: Crappy old shorts and a tank top.  This is how I dress for work. Because my job is to get puked on.
Demosthenes: So is mine.  I work in IT.


bananaskittles: The world is 4chan and God is a troll.

Probie

  • Professional Blogger
  • ***
  • Coolio Points: +223/-5
  • Offline Offline
  • Posts: 644
  • The natural nap catalyst
    • View Profile
    • SoggyBlog


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.
Logged
// ------- Probie ------- //
// ----------------------- //
// --- T3H GEEKERY --- //
// ----------------------- //
www.niccisixx.com - I can put this here, because I'm awesome.

jeee

  • Dork
  • ***
  • Coolio Points: +189/-4
  • Offline Offline
  • Gender: Male
  • Posts: 796
    • View Profile

Can you lay next to me and whisper those two posts in my ear? It's the ultimate geek porn fantasy :-D