Thread: Problems with my edit control...

  1. #16
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Are you writting in MFC and calling AfxInitRichEdit () ?

    (does not look like MFC )

    Have called InitCommonControls ()
    Obviuosly you have included richedit.h

    Put 'chCntrlName' into a messagebox before you use it to create the control and ensure it contains the correct string.

    Check the hwnd and hInstance.
    Try creating an edit (instead of the richedit) and see if that can be created. That is find if the create is OK.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  2. #17
    Registered User
    Join Date
    May 2002
    Posts
    132
    I am not using MFC, and nothing I have ever read told me to call InitCommonControls()... however, when I added the call to my program it said that it could not locate the function and assumed it was returning int. Which header do I have to include in order to call this function? My current includes are as follows:

    windows.h
    process.h
    richedit.h
    stdio.h
    token.h

  3. #18
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Bugger!

    You need to InitCommonControls to use anything like listviews, treeviews or richedits.

    commctrl.h
    comctl32.lib
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #19
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    I've never understood why InitCommonControls() is necessary, when you link with comctl32.lib. Is it because comctl32.lib is only a static link library?
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  5. #20
    Registered User
    Join Date
    May 2002
    Posts
    132
    I've included the commctrl.h and added the comctl32.lib to my project, however, it still doesn't create the richedit and I still receive the 1407 error.

    Any other suggestions?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can't disable ctrl-V on a rich edit control
    By rakan in forum Windows Programming
    Replies: 1
    Last Post: 02-06-2008, 08:37 AM
  2. Controlling edit control input
    By Gerread in forum Windows Programming
    Replies: 6
    Last Post: 05-03-2007, 08:56 PM
  3. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  4. How can I send a text string to an edit control
    By marc74 in forum Windows Programming
    Replies: 5
    Last Post: 01-06-2005, 10:14 PM
  5. Get Notified of ENTER in single line EDIT control
    By Morpheus in forum Windows Programming
    Replies: 1
    Last Post: 06-29-2002, 07:07 PM