Click here to Skip to main content
15,911,785 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralExplorer.exe Pin
compwiz12-Dec-99 13:39
compwiz12-Dec-99 13:39 
GeneralRE: Explorer.exe Pin
Mike Dunn14-Dec-99 15:21
Mike Dunn14-Dec-99 15:21 
GeneralRE: RE: Explorer.exe Pin
Mike Dunn14-Dec-99 15:34
Mike Dunn14-Dec-99 15:34 
GeneralRestarting the shell Pin
Mike Dunn14-Dec-99 15:38
Mike Dunn14-Dec-99 15:38 
GeneralMultiple File Formats Loading and Saving Pin
Jesse Ezell11-Dec-99 19:10
Jesse Ezell11-Dec-99 19:10 
QuestionRich Edit Ctrl in dialog? Pin
Steve Roach11-Dec-99 12:59
Steve Roach11-Dec-99 12:59 
AnswerRE: Rich Edit Ctrl in dialog? Pin
Jesse Ezell11-Dec-99 19:07
Jesse Ezell11-Dec-99 19:07 
AnswerRE: Rich Edit Ctrl in dialog? Pin
Andrei Zenkovitch13-Dec-99 8:24
Andrei Zenkovitch13-Dec-99 8:24 
Hi Steve,

The problem has to do with the fact that when CDialog tries to create a dialog window from the resource template internally it does by calling ::CreateWindowEx() function. The most important argument in this function is the name of the window class (like "Static" for static control or "Edit" for edit control). It is required that before window is created its window class must be registered. MFC does it internally for common controls but not for rich edit control which implementation resides in different dll. So when you call DoModal() function the internal Windows implementation will fail to create the rich edit control and therefore the creation of the dialog will fail as well.

Now how to fix the problem.
You just have to load the dll that contains rich edit control implementation in your InitInstance() function:

HINSTANCE hRichEdDLL=::LoadLibrary(_T("RICHED32.DLL");
if(g_hRichEdDLL==NULL)
TRACE(_T("Cannot load library to display RichEditTextControl"));


Regards,
Andrei Zenkovitch
Dundas Software

P.S. I assumed you were using MFC. If it is not the case then above mentioned explanations are still valid.
==================
The original message was:

I'm using VC++5. I find that when I use the resource editor to put a Rich Edit control in a dialog that is used either as part of a property sheet or as a dialog started from a menu option that the DoModal dialog callreturns -1 indicating that the box could not be created. (The same thing happens in VC++6). I searched the help and found no mention of any such limitation - it seems logical to be able to do it as the control is in the toolbar in the resource editor. I guess I must be doing something wrong. Any ideas?

Steve
GeneralRE: RE: Rich Edit Ctrl in dialog? Pin
Steve Roach14-Dec-99 3:40
Steve Roach14-Dec-99 3:40 
GeneralModeless Dialog Boxes Pin
Anonymous11-Dec-99 9:40
suss Anonymous11-Dec-99 9:40 
GeneralRE: Modeless Dialog Boxes Pin
Anonymous11-Dec-99 12:55
suss Anonymous11-Dec-99 12:55 
GeneralRE: Modeless Dialog Boxes Pin
Stefan Ernsperger13-Dec-99 20:16
sussStefan Ernsperger13-Dec-99 20:16 
QuestionVB Control Arrays in VC++? Pin
Marc Howe10-Dec-99 6:59
Marc Howe10-Dec-99 6:59 
GeneralStatic text (in)visible Pin
Marc Howe10-Dec-99 5:18
Marc Howe10-Dec-99 5:18 
GeneralRE: Static text (in)visible Pin
Peter Zajac10-Dec-99 6:00
Peter Zajac10-Dec-99 6:00 
GeneralRE: Static text (in)visible Pin
Anonymous12-Dec-99 21:43
suss Anonymous12-Dec-99 21:43 
General"Code keeper" type program in VC++ Pin
Marc Howe10-Dec-99 5:16
Marc Howe10-Dec-99 5:16 
GeneralDLLs? Pin
Member 40415-Dec-99 7:52
Member 40415-Dec-99 7:52 
GeneralChange CEdit font Pin
Jeremy Davis10-Dec-99 3:42
Jeremy Davis10-Dec-99 3:42 
GeneralRE: Change CEdit font Pin
Alex Gorev10-Dec-99 4:37
Alex Gorev10-Dec-99 4:37 
GeneralRE: RE: Change CEdit font Pin
Jeremy Davis12-Dec-99 22:13
Jeremy Davis12-Dec-99 22:13 
GeneralRE: RE: Change CEdit font Pin
Jeremy Davis13-Dec-99 1:19
Jeremy Davis13-Dec-99 1:19 
GeneralExternal program execution Pin
Mark9-Dec-99 3:47
Mark9-Dec-99 3:47 
GeneralRE: External program execution Pin
Peter Zajac9-Dec-99 4:14
Peter Zajac9-Dec-99 4:14 
GeneralRE: RE: External program execution Pin
Mark12-Dec-99 4:38
Mark12-Dec-99 4:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.