Click here to Skip to main content
15,886,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Hi All Pin
ThatsAlok1-Jun-05 19:18
ThatsAlok1-Jun-05 19:18 
GeneralAbout <b>FindFirstChangeNotification</b> and <b>ReadDirectoryChangeW</b> Pin
a_du1-Jun-05 16:31
a_du1-Jun-05 16:31 
GeneralRe: About <b>FindFirstChangeNotification</b> and <b>ReadDirectoryChangeW</b> Pin
ThatsAlok1-Jun-05 18:51
ThatsAlok1-Jun-05 18:51 
GeneralRe: About <b>FindFirstChangeNotification</b> and <b>ReadDirectoryChangeW</b> Pin
a_du1-Jun-05 23:41
a_du1-Jun-05 23:41 
GeneralRe: About <b>FindFirstChangeNotification</b> and <b>ReadDirectoryChangeW</b> Pin
ThatsAlok1-Jun-05 23:55
ThatsAlok1-Jun-05 23:55 
GeneralRe: About <b>FindFirstChangeNotification</b> and <b>ReadDirectoryChangeW</b> Pin
S. Senthil Kumar1-Jun-05 23:45
S. Senthil Kumar1-Jun-05 23:45 
GeneralRe: About <b>FindFirstChangeNotification</b> and <b>ReadDirectoryChangeW</b> Pin
ThatsAlok1-Jun-05 23:57
ThatsAlok1-Jun-05 23:57 
GeneralPostMessage causing hang... Pin
Ian Bowler1-Jun-05 16:25
Ian Bowler1-Jun-05 16:25 
Hello!

Here's my situation. I have a dialog with a CEdit-derived object and CListCtrl-derived object. When someone is typing in the edit control and they hit Enter, I want the text to be copied to the CListCtrl.

The CDialog class that contains these controls has a method that gets the text from the edit control and inserts it into the CListCtrl.

My problem is trapping the Enter key in the edit box and getting the dialog to call it's method that copies from the edit box to the list control.

I think I'm going about this all wrong. What I'm currently trying to do in the CEdit-derived class is this:

void CMyEdit::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// If Enter has been pressed, we need to post this message to the dialog.

if(nChar == 13)
{
// Get a handle to our dialog window
CWnd* pDialogWnd = GetParent();

// Post the message to our dialog window
pDialogWnd->PostMessage(WM_KEYUP, VK_RETURN, 0);
}

CEdit::OnKeyUp(nChar, nRepCnt, nFlags);
}

I implement the WM_KEYUP message in the parent dialog class as follows:

void CMyDlg::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// If Enter has been pressed, we need to update the rules list
if(nChar == 13)
{
UpdateRulesList();
}

CDialog::OnKeyUp(nChar, nRepCnt, nFlags);
}

But I end up hanging somewhere after my UpdateRulesList method executes (the problem is not in UpdateRulesList (at least I can call it from the dialog object and it works just fine)). I must be generating some kind of endless message loop or something...

Any help would be greatly appreciated!

Thanks!

-Ian



GeneralRe: PostMessage causing hang... Pin
Christian Graus1-Jun-05 16:43
protectorChristian Graus1-Jun-05 16:43 
GeneralRe: PostMessage causing hang... Pin
Ian Bowler1-Jun-05 16:48
Ian Bowler1-Jun-05 16:48 
GeneralRe: PostMessage causing hang... Pin
Christian Graus1-Jun-05 16:51
protectorChristian Graus1-Jun-05 16:51 
GeneralRe: PostMessage causing hang... Pin
S. Senthil Kumar1-Jun-05 23:50
S. Senthil Kumar1-Jun-05 23:50 
GeneralRe: PostMessage causing hang... Pin
Nilesh K.1-Jun-05 16:49
Nilesh K.1-Jun-05 16:49 
GeneralRe: PostMessage causing hang... Pin
Ian Bowler1-Jun-05 16:57
Ian Bowler1-Jun-05 16:57 
GeneralRe: PostMessage causing hang... Pin
Nilesh K.1-Jun-05 17:02
Nilesh K.1-Jun-05 17:02 
GeneralRe: PostMessage causing hang... Pin
Ian Bowler1-Jun-05 17:04
Ian Bowler1-Jun-05 17:04 
GeneralRe: PostMessage causing hang... Pin
Nilesh K.1-Jun-05 17:14
Nilesh K.1-Jun-05 17:14 
GeneralRe: PostMessage causing hang... Pin
Ian Bowler1-Jun-05 17:19
Ian Bowler1-Jun-05 17:19 
GeneralRe: PostMessage causing hang... Pin
Nilesh K.1-Jun-05 17:31
Nilesh K.1-Jun-05 17:31 
GeneralRe: PostMessage causing hang... Pin
ThatsAlok1-Jun-05 18:38
ThatsAlok1-Jun-05 18:38 
GeneralRe: PostMessage causing hang... Pin
Nilesh K.1-Jun-05 19:15
Nilesh K.1-Jun-05 19:15 
GeneralRe: PostMessage causing hang... Pin
ThatsAlok1-Jun-05 19:19
ThatsAlok1-Jun-05 19:19 
GeneralRe: PostMessage causing hang... Pin
S. Senthil Kumar2-Jun-05 0:02
S. Senthil Kumar2-Jun-05 0:02 
GeneralRe: PostMessage causing hang... Pin
S. Senthil Kumar1-Jun-05 23:57
S. Senthil Kumar1-Jun-05 23:57 
GeneralDynamically updating property sheets or formviews Pin
connere241-Jun-05 15:29
connere241-Jun-05 15:29 

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.