Click here to Skip to main content
15,914,820 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Use Sockets in a DLL Pin
xxrl17-Oct-05 20:23
xxrl17-Oct-05 20:23 
GeneralRe: Use Sockets in a DLL Pin
tobeymag18-Oct-05 19:20
tobeymag18-Oct-05 19:20 
GeneralRe: Use Sockets in a DLL Pin
xxrl19-Oct-05 19:16
xxrl19-Oct-05 19:16 
QuestionCould you help me with Rich Edit? Pin
Reunion17-Oct-05 19:25
Reunion17-Oct-05 19:25 
QuestionRe: Could you help me with Rich Edit? Pin
David Crow18-Oct-05 3:30
David Crow18-Oct-05 3:30 
AnswerRe: Could you help me with Rich Edit? Pin
Reunion18-Oct-05 18:22
Reunion18-Oct-05 18:22 
GeneralRe: Could you help me with Rich Edit? Pin
David Crow19-Oct-05 2:46
David Crow19-Oct-05 2:46 
GeneralRe: Could you help me with Rich Edit? Pin
Reunion19-Oct-05 17:20
Reunion19-Oct-05 17:20 
QuestionRe: Could you help me with Rich Edit? Pin
David Crow20-Oct-05 4:21
David Crow20-Oct-05 4:21 
AnswerRe: Could you help me with Rich Edit? Pin
Reunion20-Oct-05 18:12
Reunion20-Oct-05 18:12 
QuestionRe: Could you help me with Rich Edit? Pin
David Crow21-Oct-05 3:15
David Crow21-Oct-05 3:15 
AnswerRe: Could you help me with Rich Edit? Pin
Reunion21-Oct-05 3:21
Reunion21-Oct-05 3:21 
GeneralRe: Could you help me with Rich Edit? Pin
David Crow21-Oct-05 4:27
David Crow21-Oct-05 4:27 
GeneralRe: Could you help me with Rich Edit? Pin
Reunion21-Oct-05 18:08
Reunion21-Oct-05 18:08 
GeneralRe: Could you help me with Rich Edit? Pin
David Crow24-Oct-05 3:11
David Crow24-Oct-05 3:11 
GeneralRe: Could you help me with Rich Edit? Pin
Reunion25-Oct-05 18:27
Reunion25-Oct-05 18:27 
One more and final: in your case the new text replaces the whole text in the control. So it's better to use ReplaceSel function instead of SetWindowText. Now everything is correct. Here is the final code:

<br />
void CRichEditCtrlEx::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)<br />
{<br />
    bool bPasted = false;<br />
    if((toupper(nChar) == 'V' && GetAsyncKeyState(VK_CONTROL)) || (nChar == VK_INSERT && GetAsyncKeyState(VK_SHIFT)))<br />
        if(IsClipboardFormatAvailable(CF_TEXT))<br />
            if(OpenClipboard() != FALSE){<br />
                HANDLE h = GetClipboardData(CF_TEXT);<br />
                if(h != NULL){<br />
                    LPTSTR lptstr = (LPTSTR)GlobalLock(h);<br />
                    if(lptstr != NULL){<br />
                        ReplaceSel(lptstr);<br />
                        GlobalUnlock(lptstr);<br />
                        bPasted = true;<br />
                    }<br />
                }<br />
                CloseClipboard();<br />
            }<br />
    if(!bPasted)<br />
        CRichEditCtrl::OnKeyDown(nChar, nRepCnt, nFlags);<br />
}<br />


Thank you once more!
QuestionForm view timer problem. Pin
ledallam17-Oct-05 18:43
ledallam17-Oct-05 18:43 
AnswerRe: Form view timer problem. Pin
kakan17-Oct-05 19:00
professionalkakan17-Oct-05 19:00 
GeneralRe: Form view timer problem. Pin
ledallam17-Oct-05 20:53
ledallam17-Oct-05 20:53 
Questionhow to create a setup file for a MFC project Pin
vikas amin17-Oct-05 18:11
vikas amin17-Oct-05 18:11 
AnswerRe: how to create a setup file for a MFC project Pin
Christian Graus17-Oct-05 18:16
protectorChristian Graus17-Oct-05 18:16 
GeneralRe: how to create a setup file for a MFC project Pin
Eytukan17-Oct-05 23:37
Eytukan17-Oct-05 23:37 
GeneralRe: how to create a setup file for a MFC project Pin
Christian Graus18-Oct-05 11:51
protectorChristian Graus18-Oct-05 11:51 
AnswerRe: how to create a setup file for a MFC project Pin
Ravi Bhavnani17-Oct-05 18:17
professionalRavi Bhavnani17-Oct-05 18:17 
AnswerRe: how to create a setup file for a MFC project Pin
yuduntang17-Oct-05 20:50
yuduntang17-Oct-05 20:50 

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.