How to add rich edit control ??
-
Hello All, I added a Rich Edit Box to my dialog and executed the dialog now the problem is dialog is not getting displayed & no action is performed or any error is displaed. Guys can u please tell me hw to add a Rich Edit Control to my Dialog using Win32 App. ??? Thanking you, Suresh HC
-
Hello All, I added a Rich Edit Box to my dialog and executed the dialog now the problem is dialog is not getting displayed & no action is performed or any error is displaed. Guys can u please tell me hw to add a Rich Edit Control to my Dialog using Win32 App. ??? Thanking you, Suresh HC
You need to call
AfxInitRichEdit
to initialize rich edit control for app. Call this function in your application.Prasad Notifier using ATL | Operator new[],delete[][^]
-
You need to call
AfxInitRichEdit
to initialize rich edit control for app. Call this function in your application.Prasad Notifier using ATL | Operator new[],delete[][^]
Hi Prasad, Thansk for the responce. I called AfxInitRichEdit(); in my Dialog, I am getting error C2065: 'AfxInitRichEdit' : undeclared identifier Dialog which I have created is from win32 Application and not from MFC. Can u please tell me hw use rich edit box in win 32 application.
-
Hi Prasad, Thansk for the responce. I called AfxInitRichEdit(); in my Dialog, I am getting error C2065: 'AfxInitRichEdit' : undeclared identifier Dialog which I have created is from win32 Application and not from MFC. Can u please tell me hw use rich edit box in win 32 application.
Use
LoadLibrary
for initializing rich edit control. You main window procedure would look like this,LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_CREATE:
hLib = LoadLibrary("RICHED32.DLL");
break;
case WM_CLOSE:
DestroyWindow(hwnd);
FreeLibrary(hLib);
break;
..}
Prasad Notifier using ATL | Operator new[],delete[][^]
-
Use
LoadLibrary
for initializing rich edit control. You main window procedure would look like this,LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_CREATE:
hLib = LoadLibrary("RICHED32.DLL");
break;
case WM_CLOSE:
DestroyWindow(hwnd);
FreeLibrary(hLib);
break;
..}
Prasad Notifier using ATL | Operator new[],delete[][^]
-
Hi Prasad, what shd be the hlib variable type ??? and where we have to declare that variable?? error C2065: 'hLib' : undeclared identifier
Its
HMODULE
. You can declare it asHMODULE hLib;//of course you can decide how you want to manage it
I've just given example. Only thing important, you need to load dll before invoking dialog.
Prasad Notifier using ATL | Operator new[],delete[][^]
-
Its
HMODULE
. You can declare it asHMODULE hLib;//of course you can decide how you want to manage it
I've just given example. Only thing important, you need to load dll before invoking dialog.
Prasad Notifier using ATL | Operator new[],delete[][^]
Hi Prasad, I did changes as u have mentioned. But still no changes , still the dialog is not getting displayed which contains rich edit box.If i remove the Rich edit control Dialog is getting displayed. I have 3 dialogs one main another sub dialogs , in the sub dialog I have the rich edit control. The main MainDlgProc
BOOL CALLBACK MainDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { HMODULE hLib; switch(Message) { case WM_CREATE: hLib = LoadLibrary("RICHED32.DLL"); break;
and the sub dialog DlgProcBOOL CALLBACK SearchDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { HMODULE hLib; switch(Message) { case WM_CREATE: hLib = LoadLibrary("RICHED32.DLL"); break;
I am using windows 2000 OS with VC6. -
Hi Prasad, I did changes as u have mentioned. But still no changes , still the dialog is not getting displayed which contains rich edit box.If i remove the Rich edit control Dialog is getting displayed. I have 3 dialogs one main another sub dialogs , in the sub dialog I have the rich edit control. The main MainDlgProc
BOOL CALLBACK MainDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { HMODULE hLib; switch(Message) { case WM_CREATE: hLib = LoadLibrary("RICHED32.DLL"); break;
and the sub dialog DlgProcBOOL CALLBACK SearchDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { HMODULE hLib; switch(Message) { case WM_CREATE: hLib = LoadLibrary("RICHED32.DLL"); break;
I am using windows 2000 OS with VC6.Dear ! dear ! I mentioned in earlier reply, you need to load library before invoking dilaog. I'd assumed , you main application window is not dialog window in question, and window procedure I mentioned is of main window. So use given procedure with main window. You should get idea from this snippet,
hLib = LoadLibrary("RICHED32.DLL");
ret = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_MYDLG), hwnd, MyDlgProc);
if(ret == -1)
{
MessageBox(hwnd, "Dialog failed!", "Error",
MB_OK | MB_ICONINFORMATION);
}
FreeLibrary(hLib );Prasad Notifier using ATL | Operator new[],delete[][^]
-
Dear ! dear ! I mentioned in earlier reply, you need to load library before invoking dilaog. I'd assumed , you main application window is not dialog window in question, and window procedure I mentioned is of main window. So use given procedure with main window. You should get idea from this snippet,
hLib = LoadLibrary("RICHED32.DLL");
ret = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_MYDLG), hwnd, MyDlgProc);
if(ret == -1)
{
MessageBox(hwnd, "Dialog failed!", "Error",
MB_OK | MB_ICONINFORMATION);
}
FreeLibrary(hLib );Prasad Notifier using ATL | Operator new[],delete[][^]
At last ………Its working …… Thanks a lot Prasad …. I actually adding the dll file load in DlgProc after dialog load that my mistake which I did … now I have added in the WinMain ..now the dialog is getting displayed with the rich control. Thanks a lot Prasad once again …
-
At last ………Its working …… Thanks a lot Prasad …. I actually adding the dll file load in DlgProc after dialog load that my mistake which I did … now I have added in the WinMain ..now the dialog is getting displayed with the rich control. Thanks a lot Prasad once again …
If you want to use of functions on a dll you need first to load it dll and then use of functions
WhiteSky