Thread: RichEdit Not Working!

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question RichEdit Not Working!

    Ok. I was working with RICHEDIT_CLASS when I found a problem. I do InitCommonControls(); but when I try to do something like:


    CreateWindowEx(
    0,
    RICHEDIT_CLASS,
    "",
    WS_CHILD | WS_VISIBLE,
    10, 10,
    400, 150,
    hwnd,
    (HMENU)1,
    hInst,
    NULL
    );


    It says RICHEDIT_CLASS undeclared...first use this function. How do I use RICHEDIT_CLASS?
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Registered User WayTooHigh's Avatar
    Join Date
    Aug 2001
    Posts
    101
    include richedit.h

    #include <richedit.h>
    Sometimes, the farthest point from the center is the center itself.

    Your life is your canvas, it's only as beautiful as you paint it.

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    and don't forget to put:

    LoadLibrary("RichEd32.dll");

    in your code, or else it won't work.

  4. #4
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Still not working...

    I tried both and got these:


    17 c:/my documents/desk_hack.cpp
    warning: `IDCLOSE' redefined

    642 c:\dev-c_~1\include\winuser.h
    warning: this is the location of the previous definition

    6 c:/my documents/desk_hack.cpp
    ANSI C++ forbids declaration `LoadLibraryA' with no type

    6 c:/my documents/desk_hack.cpp
    `int LoadLibraryA' redeclared as different kind of symbol

    1324 c:\dev-c_~1\include\winbase.h
    previous declaration of `struct HINSTANCE__ * LoadLibraryA(const CHAR *)'

    6 c:/my documents/desk_hack.cpp
    initialization to `int' from `const char *' lacks a cast

    780 c:/my documents/desk_hack.cpp
    warning: converting NULL to non-pointer type

    819 c:/my documents/desk_hack.cpp
    `RICHEDIT_CLASS' undeclared (first use this function)

    819 c:/my documents/desk_hack.cpp
    (Each undeclared identifier is reported only once

    819 c:/my documents/desk_hack.cpp
    for each function it appears in.)
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  5. #5
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Code:
              hwndEdit = CreateWindow ("richedit", NULL,
                             WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |
                                       WS_BORDER | ES_LEFT | ES_MULTILINE |
                                       ES_AUTOHSCROLL | ES_AUTOVSCROLL,
                             0, 0, 90, 90, hwnd, (HMENU) ID_VIEW,
    						 hInst, NULL);
    I always find using the #defines are more annoying than just typing in the string yourself

    And I don't know wether you need LoadLibrary in DJGPP, but you do in MSVC. and now you don't need to include the extra header file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function not working
    By sloopy in forum C Programming
    Replies: 31
    Last Post: 11-12-2005, 08:08 PM
  2. Program Not working Right
    By raven420smoke in forum C++ Programming
    Replies: 2
    Last Post: 09-16-2005, 03:21 AM
  3. Trying to eject D drive using code, but not working... :(
    By snowfrog in forum C++ Programming
    Replies: 3
    Last Post: 05-07-2005, 07:47 PM
  4. x on upper right corner not working
    By caduardo21 in forum Windows Programming
    Replies: 1
    Last Post: 02-20-2005, 08:35 PM
  5. cygwin -> unix , my code not working properly ;(
    By CyC|OpS in forum C Programming
    Replies: 4
    Last Post: 05-18-2002, 04:08 AM