Thread: Wow I am confused. SendMessage API.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User BillBoeBaggins's Avatar
    Join Date
    Oct 2003
    Posts
    107

    Wow I am confused. SendMessage API. (Resolved)

    Okie doke, I am so darn confused as to why this piece of code is causing a segmentation fault.
    Code:
    char MyMsg[]="This is a message.\0";
    char * pMyMsg=&MyMsg[0];
    SendMessage(hwnd_MyListBox,LB_ADDSTRING,0,*pMyMsg);
    The MSDN says that the LPARAM is supposed to be a pointer.

    However when I use it without Dereferencing it
    Code:
    SendMessage(hwnd_MyListBox,LB_ADDSTRING,0,pMyMsg);
    It tells me that it is expecting a long int.

    It will compile the first way but then causes the fault.


    Thanks for all help past/present/future.
    Last edited by BillBoeBaggins; 08-19-2004 at 02:42 PM.
    May the compiler be with you.
    Be one with the compiler, and you shall prosper greatly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. a good windows API programming book
    By jpchand in forum Windows Programming
    Replies: 3
    Last Post: 10-10-2003, 06:37 AM
  2. Q about most used prog. language in C++! Confused?
    By actionbasti in forum Game Programming
    Replies: 3
    Last Post: 09-16-2003, 07:42 PM
  3. confused.. in selecting my line of deapth
    By jawwadalam in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 05-04-2003, 01:21 PM
  4. How do you toggle keys like Scroll lock without Windows API?
    By animeaholic in forum C++ Programming
    Replies: 7
    Last Post: 09-15-2002, 07:02 PM
  5. API, LOST... help
    By Unregistered in forum Windows Programming
    Replies: 5
    Last Post: 03-13-2002, 03:19 PM