Click here to Skip to main content
15,921,531 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionConstructor problem Pin
hint_5414-Apr-06 14:22
hint_5414-Apr-06 14:22 
AnswerRe: Constructor problem Pin
georgeraafat14-Apr-06 14:41
georgeraafat14-Apr-06 14:41 
GeneralRe: Constructor problem Pin
hint_5414-Apr-06 14:45
hint_5414-Apr-06 14:45 
GeneralRe: Constructor problem Pin
georgeraafat14-Apr-06 15:08
georgeraafat14-Apr-06 15:08 
GeneralRe: Constructor problem Pin
hint_5414-Apr-06 16:00
hint_5414-Apr-06 16:00 
AnswerRe: Constructor problem Pin
Saurabh.Garg14-Apr-06 15:11
Saurabh.Garg14-Apr-06 15:11 
GeneralRe: Constructor problem Pin
hint_5414-Apr-06 16:00
hint_5414-Apr-06 16:00 
QuestionCan not copy from RichEdit control Pin
White Owl14-Apr-06 11:49
White Owl14-Apr-06 11:49 
I am working win WinAPI (not MFC!). Created RichEdit control and it works fine except one small problem. If user select some text in RichEdit control and hit Ctrl+C - nothing goes to clipboard.

Here is creation code:
	if (SearchPath(NULL, "RICHED32.DLL", NULL, sizeof(sBuf), sBuf, &s)>0) {<br />
		hRE_Lib = LoadLibrary("RICHED32");<br />
	} else if(SearchPath(NULL, "RICHED21.DLL", NULL, sizeof(sBuf), sBuf, &s)>0) {<br />
		hRE_Lib = LoadLibrary("RICHED21");<br />
	} else {<br />
		hRE_Lib = NULL;<br />
	}<br />
	if (hRE_Lib == NULL) {<br />
        MessageBox(NULL, "Can not find RichEdit library!", "Error!",<br />
            MB_ICONEXCLAMATION | MB_OK);<br />
        return 0;<br />
	}<br />
<br />
	hRichEdit = CreateWindowEx(<br />
		WS_EX_CLIENTEDGE,<br />
		"RICHEDIT", "",<br />
		WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |<br />
			ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | ES_READONLY,<br />
		1,1,50,100,<br />
		hwnd, NULL,<br />
		(HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE),<br />
		NULL);<br />
	<br />
    if(hRichEdit == NULL) {<br />
        MessageBox(NULL, "Rich Edit Creation Failed!", "Error!",<br />
            MB_ICONEXCLAMATION | MB_OK);<br />
        return 0;<br />
    }<br />
	SendMessage(hRichEdit, WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE);<br />


Right now, I am thinking about using
SendMessage(hRichEdit, EM_SETEVENTMASK, (WPARAM)NULL, (LPARAM)ENM_KEYEVENTS);
with some code in WndProc which would wait for Ctrl+C and send selected text from RichEdit to clipboard. But may be problem can be fixed more easy?
BTW Ctrl+A already works in my RichEdit control, so I do not understand why Ctrl+C do not work by default. There is only simple text. I am adding it by command SendMessage(hRichEdit, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)TextBuffer);
Questionfatal error C1010: Pin
jinbabaj14-Apr-06 9:56
jinbabaj14-Apr-06 9:56 
AnswerRe: fatal error C1010: Pin
Chris Losinger14-Apr-06 10:12
professionalChris Losinger14-Apr-06 10:12 
AnswerRe: fatal error C1010: Pin
Michael Dunn14-Apr-06 10:35
sitebuilderMichael Dunn14-Apr-06 10:35 
QuestionWindows 2003 server / remote desktop Pin
BusaBird14-Apr-06 9:28
BusaBird14-Apr-06 9:28 
AnswerRe: Windows 2003 server / remote desktop Pin
David Crow14-Apr-06 9:35
David Crow14-Apr-06 9:35 
GeneralRe: Windows 2003 server / remote desktop Pin
BusaBird14-Apr-06 21:04
BusaBird14-Apr-06 21:04 
GeneralRe: Windows 2003 server / remote desktop Pin
David Crow17-Apr-06 3:12
David Crow17-Apr-06 3:12 
QuestionHow to call a Visual C++, Dialog Based, member function Pin
EW_dude14-Apr-06 8:34
EW_dude14-Apr-06 8:34 
AnswerRe: How to call a Visual C++, Dialog Based, member function Pin
Chris Losinger14-Apr-06 8:48
professionalChris Losinger14-Apr-06 8:48 
GeneralRe: How to call a Visual C++, Dialog Based, member function Pin
EW_dude14-Apr-06 9:38
EW_dude14-Apr-06 9:38 
GeneralRe: How to call a Visual C++, Dialog Based, member function Pin
David Crow14-Apr-06 9:49
David Crow14-Apr-06 9:49 
GeneralRe: How to call a Visual C++, Dialog Based, member function Pin
Chris Losinger14-Apr-06 10:11
professionalChris Losinger14-Apr-06 10:11 
AnswerRe: How to call a Visual C++, Dialog Based, member function Pin
Maxwell Chen14-Apr-06 11:00
Maxwell Chen14-Apr-06 11:00 
QuestionHow to move a file based on its extension only? Pin
Lynniz14-Apr-06 7:43
Lynniz14-Apr-06 7:43 
AnswerRe: How to move a file based on its extension only? Pin
Chris Losinger14-Apr-06 7:57
professionalChris Losinger14-Apr-06 7:57 
GeneralRe: How to move a file based on its extension only? Pin
Lynniz14-Apr-06 8:16
Lynniz14-Apr-06 8:16 
GeneralRe: How to move a file based on its extension only? Pin
David Crow14-Apr-06 8:25
David Crow14-Apr-06 8:25 

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.