// The global vars
HINSTANCE hinst_RE32Dll;
HWND h_RE;
// This is inside WinMain
hinst_RE32Dll = LoadLibrary("Msftedit.dll");
// And this is inside the DialogProc function
case WM_INITDIALOG:
Main = hWnd;
RE = CreateWindowEx(0, RICHEDIT_CLASS, 0, WS_VISIBLE | ES_SUNKEN |
WS_CHILDWINDOW | WS_CLIPSIBLINGS | ES_MULTILINE | WS_CHILD |
ES_NOHIDESEL | WS_VSCROLL | ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_HSCROLL ,
0, 0, 0, 0, hWnd, (HMENU) NULL, (HINSTANCE)GetWindowLong(Main,GWL_HINSTANCE), NULL);
break;
Now, the problem is that when i start my program, i don't see any richedit control.
Was wondering if anyone would have any idea why this happens and how to fix this.
[edited by - Alura on January 27, 2004 5:29:02 PM]
[edited by - Alura on January 27, 2004 5:29:32 PM]
[edited by - Alura on January 28, 2004 1:45:55 PM]
🔒 Locked
Win32 - RichEdit
Advertisement
Original Post
Well, i've setupped it using dialogs with the following code:
In order to use a RichEditCtrl, you must at some point before attempting to display it call AfxInitRichEdit. If you don''t it won''t show up and/or will crash your app. So, try that.
-fel
-fel
quote:
Original post by Anonymous Poster
Are you sure that is the right DLL? The MFC source loads RICHED32.DLL.
It depends on the version of the Rich Edit control youre trying to load.
AfxInitRichEdit() is an MFC macro. If you do not wish to use it, InitCommonControlsEx() is there to help you.
Colin Jeanne | Invader''s Realm
Colin Jeanne | Invader''s Realm
He''s not using MFC. I don''t think it likes a size of 0, 0. Try giving it a specific size. Also, the library is:
riched20.dll
---------------------------------------
Let''s struggle for our dream of Game!
http://andrewporritt.4t.com
riched20.dll
---------------------------------------
Let''s struggle for our dream of Game!
http://andrewporritt.4t.com
Generally it's best if you start a new thread rather than pull up an old one.
But while I'm here...
I might as well help you
Colin Jeanne | Invader's Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
[edited by - Invader X on April 11, 2004 10:04:20 PM]
But while I'm here...
I might as well help you
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
[edited by - Invader X on April 11, 2004 10:04:20 PM]
Sorry I didn''t know. It''s only that when I try to create a window with the RICHEDIT_CLASS class name, if I load the Msftedit.dll library instead of Riched20.dll, CreateWindow (or CreateWindowEX) fails and GetLastError reports Class name not found, I think that Msftedit requires another class name, but user Alura says he/she got it with InitCommonControlsEx. I''ve tried with some dwICC member values, but I got nothing. Thank you very much.
Double check that LoadLibrary() does not fail. Remember that Msftedit.dll only exists on machines with WinXP SP1.
Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
quote:
Original post by mindundi
Yes, I have XP with SP1, and LoadLibrary does not return NULL. What do you mean with "double" check?
I meant make sure that LoadLibrary() does not return NULL.
Can you post the code you use to create the rich edit using Msftedit.dll?
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
If you use MSFTEDIT.dll, your code will only work on windows XP. Whats wrong with RICHED20.dll ?
Edit: on my compiler RICHEDIT_CLASS expands to "RichEdit20A"...
[edited by - Evil Steve on April 22, 2004 1:46:15 PM]
Edit: on my compiler RICHEDIT_CLASS expands to "RichEdit20A"...
[edited by - Evil Steve on April 22, 2004 1:46:15 PM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement