Click here to Skip to main content
15,891,859 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to display a image in a particular control Pin
Hristo-Bojilov31-May-10 23:59
Hristo-Bojilov31-May-10 23:59 
AnswerRe: how to display a image in a particular control Pin
Richard MacCutchan1-Jun-10 0:03
mveRichard MacCutchan1-Jun-10 0:03 
AnswerRe: how to display a image in a particular control Pin
«_Superman_»1-Jun-10 0:07
professional«_Superman_»1-Jun-10 0:07 
QuestionHow to replace occurance of one character in a string ? Pin
s v joshi31-May-10 23:19
s v joshi31-May-10 23:19 
AnswerRe: How to replace occurance of one character in a string ? Pin
«_Superman_»31-May-10 23:25
professional«_Superman_»31-May-10 23:25 
AnswerRe: How to replace occurance of one character in a string ? Pin
rp_suman31-May-10 23:30
rp_suman31-May-10 23:30 
AnswerRe: How to replace occurance of one character in a string ? Pin
Aescleal1-Jun-10 1:13
Aescleal1-Jun-10 1:13 
QuestionOnKeyDown() & PreTranslateMsg() Pin
Anu_Bala31-May-10 22:55
Anu_Bala31-May-10 22:55 
Hi,
In my MDI application,i have one Group view with more No of views.I will get every page by using PageUp and PageDown.
So i coded in OnKeyDown() to get this function.
But when i press PAGEDOWN or PAGEUP,it doesnot go to that function part.But when i press like
SHIFT+PAGEDOWN it works.

So i use PreTranslateMsg() coding,i copied same coding form OnKeyDown(),but when i press PAGEDOWN it works but it move to 3rd page not 2nd page.It goes like 3,5,7 page.

When i use Mouse roll it works fine in OnKeyDown().
void CGroupView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{	
	if(nChar == 17)
		return;		
        BOOL bMax;
	CView *curView;
	CMDIFrameWnd *fWnd = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
	CMDIChildWnd *fChWnd = fWnd->MDIGetActive(&bMax);
	
	if(fChWnd->GetSafeHwnd())
		curView = (CView *)fChWnd->GetActiveView();
	else
		curView = NULL;
	
	
	switch(nChar)
	{
	case 33://Page Up
		{
		giGrPNo--;
		if(giGrPNo<1)
			giGrPNo=1;//iGrpCnt;
		else
		{
			Invalidate(FALSE);
		}
		iTagNo = -1;
		break;
		}
		case 34://Page Down
		{
		giGrPNo++;
		if(giGrPNo > iGrpCnt)
			giGrPNo = iGrpCnt; // //giGrPNo=1;
		else
		{
			Invalidate(FALSE);				
		}
			iTagNo = -1;
			break;
		}
}


BOOL CGroupView::PreTranslateMessage(MSG* pMsg)
{
	UINT nChar = (UINT)pMsg->wParam;
	UINT nKeyDown = (UINT)pMsg->lParam;

<..Same coding from OnKeyDown()..>
}


When i press PAGEDOWN it should go to that function part.What can i do?
Anu

AnswerRe: OnKeyDown() & PreTranslateMsg() Pin
CPallini31-May-10 23:14
mveCPallini31-May-10 23:14 
GeneralRe: OnKeyDown() & PreTranslateMsg() Pin
Anu_Bala31-May-10 23:25
Anu_Bala31-May-10 23:25 
GeneralRe: OnKeyDown() & PreTranslateMsg() Pin
rp_suman31-May-10 23:43
rp_suman31-May-10 23:43 
QuestionCM_Query_And_Remove_SubTree API returns CR_REMOVE_VETOED in xp sp3 Pin
aks.31-May-10 21:27
aks.31-May-10 21:27 
QuestionUser account lock Pin
Pryabu31-May-10 20:31
Pryabu31-May-10 20:31 
AnswerRe: User account lock Pin
Spawn@Melmac1-Jun-10 1:37
Spawn@Melmac1-Jun-10 1:37 
GeneralRe: User account lock Pin
Pryabu1-Jun-10 19:32
Pryabu1-Jun-10 19:32 
GeneralRe: User account lock Pin
Spawn@Melmac2-Jun-10 6:28
Spawn@Melmac2-Jun-10 6:28 
QuestionNo of Documents and View in SDI and MDI Pin
krishna_CP31-May-10 20:00
krishna_CP31-May-10 20:00 
AnswerRe: No of Documents and View in SDI and MDI Pin
«_Superman_»31-May-10 20:17
professional«_Superman_»31-May-10 20:17 
GeneralRe: No of Documents and View in SDI and MDI Pin
Cedric Moonen31-May-10 20:41
Cedric Moonen31-May-10 20:41 
GeneralRe: No of Documents and View in SDI and MDI Pin
krishna_CP2-Jun-10 3:28
krishna_CP2-Jun-10 3:28 
GeneralRe: No of Documents and View in SDI and MDI Pin
Cedric Moonen2-Jun-10 4:25
Cedric Moonen2-Jun-10 4:25 
GeneralRe: No of Documents and View in SDI and MDI Pin
krishna_CP2-Jun-10 4:28
krishna_CP2-Jun-10 4:28 
AnswerRe: No of Documents and View in SDI and MDI Pin
Aescleal31-May-10 20:39
Aescleal31-May-10 20:39 
AnswerRe: No of Documents and View in SDI and MDI Pin
Niklas L1-Jun-10 3:49
Niklas L1-Jun-10 3:49 
GeneralRe: No of Documents and View in SDI and MDI Pin
krishna_CP2-Jun-10 3:29
krishna_CP2-Jun-10 3: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.