I'm having a bit of trouble...

This is a discussion on I'm having a bit of trouble... within the Windows Programming forums, part of the Platform Specific Boards category; In my WM_CREATE in the WinProc, I have this: Code: LPACCEL cas; cas->fVirt = FCONTROL; cas->key = (73); cas->cmd = ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,340
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 06: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, 07: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21