Click here to Skip to main content
15,032,967 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Requirements of display filtering in power electronics data Pin
Richard MacCutchan19-Aug-21 21:33
mveRichard MacCutchan19-Aug-21 21:33 
AnswerRe: Requirements of display filtering in power electronics data Pin
11917640 Member 22-Aug-21 4:33
Member11917640 Member 22-Aug-21 4:33 
GeneralRe: Requirements of display filtering in power electronics data Pin
Md Mubdiul Hasan 22-Aug-21 15:12
MemberMd Mubdiul Hasan 22-Aug-21 15:12 
QuestionImplementing a mathematical PI control for a reasonable "if" structure Pin
Md Mubdiul Hasan 18-Aug-21 18:37
MemberMd Mubdiul Hasan 18-Aug-21 18:37 
AnswerRe: Implementing a mathematical PI control for a reasonable "if" structure Pin
markkuk18-Aug-21 20:18
Membermarkkuk18-Aug-21 20:18 
GeneralRe: Implementing a mathematical PI control for a reasonable "if" structure Pin
Md Mubdiul Hasan 18-Aug-21 20:46
MemberMd Mubdiul Hasan 18-Aug-21 20:46 
AnswerRe: Implementing a mathematical PI control for a reasonable "if" structure Pin
Richard MacCutchan18-Aug-21 22:19
mveRichard MacCutchan18-Aug-21 22:19 
QuestionHandling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
ForNow30-Jul-21 4:07
MemberForNow30-Jul-21 4:07 
I saw an article about this on the codeproject by
Nish Nishant
and it seems pretty simple first let me post his code
BOOL CPreTransTestApp::ProcessMessageFilter(int code, LPMSG lpMsg) 
{
    if(m_haccel)
    {
        if (::TranslateAccelerator(m_pMainWnd->m_hWnd, m_haccel, lpMsg)) 
            return(TRUE);
    }
	
    return CWinApp::ProcessMessageFilter(code, lpMsg);
}


Now let me expain my scenrio I am running a client server TCPI /IP program the server is a z/os mainframe and the client is a MFC C\C++ windows based program which displays data from the mainframe
I can have up to 4 modeless dialog boxes which display data in a rich edit their pointers live are my derived CWinApp
CDBGRApp

I did all the front end work created the accelarator in my resource file had it as selection in my menu "MENUITEM" and put the appropriate message map and message handler in derived CDialog CProgDebug

I then inserted the following code into my derived CWinAppp CDBGRApp
OOL CDBGRApp::ProcessMessageFilter(int code, LPMSG lpMsg)
{
	
	if (m_haccel)
	{
		if (debugger[0] == NULL);
		else
		{
			if (debugger[0]->m_hWnd == NULL);
			else
			{
			::TranslateAccelerator(debugger[0]->m_hWnd, m_haccel, lpMsg);
			return(TRUE);
			}

		}
	}
		return CWinApp::ProcessMessageFilter(code, lpMsg);
	}

debugger[0] is the first of an array defined as
CProgDebug *debugger[4];

After I created the CProgDebug with it rich edit the window didnt seem to take any input mouse or keyboard

Nish in his code didnt specify that after doing TranslateAccelrator and would have to do TranslateMessage and DispatchMessage from the msg structure as I assume that is being taken care of somewhere down the line by the frameWork
AnswerRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Graham Breach30-Jul-21 4:40
MemberGraham Breach30-Jul-21 4:40 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
ForNow30-Jul-21 5:59
MemberForNow30-Jul-21 5:59 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Graham Breach30-Jul-21 6:29
MemberGraham Breach30-Jul-21 6:29 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
ForNow30-Jul-21 7:23
MemberForNow30-Jul-21 7:23 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Graham Breach30-Jul-21 8:17
MemberGraham Breach30-Jul-21 8:17 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
ForNow30-Jul-21 8:28
MemberForNow30-Jul-21 8:28 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Graham Breach30-Jul-21 8:49
MemberGraham Breach30-Jul-21 8:49 
AnswerRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Richard MacCutchan30-Jul-21 4:56
mveRichard MacCutchan30-Jul-21 4:56 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
ForNow30-Jul-21 5:11
MemberForNow30-Jul-21 5:11 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Richard MacCutchan30-Jul-21 5:28
mveRichard MacCutchan30-Jul-21 5:28 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Dave Kreskowiak30-Jul-21 6:10
mveDave Kreskowiak30-Jul-21 6:10 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Richard MacCutchan30-Jul-21 6:15
mveRichard MacCutchan30-Jul-21 6:15 
QuestionDynamically creating CToolBar Pin
Benjamin Bruno30-Jul-21 3:54
MemberBenjamin Bruno30-Jul-21 3:54 
AnswerRe: Dynamically creating CToolBar Pin
Richard MacCutchan30-Jul-21 4:52
mveRichard MacCutchan30-Jul-21 4:52 
QuestionRGB image to CMYK gdi+ Pin
Gopi Nath15-Jul-21 22:25
MemberGopi Nath15-Jul-21 22:25 
AnswerRe: RGB image to CMYK gdi+ Pin
Richard MacCutchan17-Jul-21 6:15
mveRichard MacCutchan17-Jul-21 6:15 
QuestionException handler Pin
Drugodrf14-Jul-21 6:39
MemberDrugodrf14-Jul-21 6:39 

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.