Thread: I'm having a bit of trouble...

  1. #1
    Rad gcn_zelda's Avatar
    Join Date
    Mar 2003
    Posts
    942

    I'm having a bit of trouble...

    In my WM_CREATE in the WinProc, I have this:

    Code:
    LPACCEL cas;
    cas->fVirt = FCONTROL;
    cas->key = (73);
    cas->cmd = PostMessage(hwnd, WM_COMMAND | ID_FILE_SAVEAS, 0, 0);
    CreateAcceleratorTable(cas, 1);
    It creates no errors or compiler warnings, but for some reason, I can't figure out why, the program creates an error when I run it. Something like "ProPad created an error in ProPad.exe".

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Probably because your disguised pointer isn't actually pointing anywhere.

    ACCEL cas;
    cas.fVirt = FCONTROL;
    cas.key = (73);
    cas.cmd = PostMessage(hwnd, WM_COMMAND | ID_FILE_SAVEAS, 0, 0);
    CreateAcceleratorTable(&cas, 1);
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Rad gcn_zelda's Avatar
    Join Date
    Mar 2003
    Posts
    942
    Thanks. I'm not the best with structures and pointers and crap.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. bit value check efficiency
    By George2 in forum C Programming
    Replies: 5
    Last Post: 11-05-2007, 07:59 AM
  2. Porting from 32 bit machine to 64 bit machine!
    By anoopks in forum C Programming
    Replies: 10
    Last Post: 02-25-2005, 08:02 PM
  3. Bit Manipulation Questions
    By CPPNewbie in forum C++ Programming
    Replies: 7
    Last Post: 08-12-2003, 02:17 PM
  4. Array of boolean
    By DMaxJ in forum C++ Programming
    Replies: 11
    Last Post: 10-25-2001, 11:45 PM