Click here to Skip to main content
15,904,416 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CListCtrl: max number of rows Pin
_AnsHUMAN_ 30-Jul-08 1:59
_AnsHUMAN_ 30-Jul-08 1:59 
GeneralRe: CListCtrl: max number of rows Pin
Gerhard-E30-Jul-08 2:08
Gerhard-E30-Jul-08 2:08 
QuestionProgress bar is not updated. while background process is running on the dialog Pin
ptr_Electron30-Jul-08 1:44
ptr_Electron30-Jul-08 1:44 
AnswerRe: Progress bar is not updated. while background process is running on the dialog Pin
CPallini30-Jul-08 2:01
mveCPallini30-Jul-08 2:01 
AnswerRe: Progress bar is not updated. while background process is running on the dialog Pin
Mark Salsbery30-Jul-08 6:51
Mark Salsbery30-Jul-08 6:51 
GeneralRe: Progress bar is not updated. while background process is running on the dialog Pin
ptr_Electron30-Jul-08 19:55
ptr_Electron30-Jul-08 19:55 
GeneralRe: Progress bar is not updated. while background process is running on the dialog Pin
Mark Salsbery31-Jul-08 7:32
Mark Salsbery31-Jul-08 7:32 
QuestionProviding an implementation of virtual void CMyFormView::PreTranslateMessage(MSG* pMsg) in order to know when the user presses return, focus, CListCtrl Pin
Sternocera30-Jul-08 1:24
Sternocera30-Jul-08 1:24 
Hello,

I'm having a problem with my MFC program. It's an MS outlook style splitter window application. In one of it's CFormViews, I want the user to be able to open a dialog that relates to the currently selected row of a report style List, when they press return, just like MS outlook. If the user interacts with the view, this virtual function is called:

BOOL CMyFormView::PreTranslateMessage(MSG* pMsg)
{
	// If the focus isn't the ReportCtrl, we aren't
	// interested in catching the message
	if(GetFocus() != &ReportCtrl)
		return CFormView::PreTranslateMessage(pMsg);
	// If the user has pressed enter, post a message
	// to the current view
	if (pMsg->wParam == VK_RETURN )
	{
		PostMessageA(ID_OPEN_RECORD,0,0); // Post a message that opens the dialog
		// Don't return CFormView::PreTranslateMessage(pMsg);
		// Don't propogate message any further - 
		// catch it
		return TRUE;
	}
	return CFormView::PreTranslateMessage(pMsg);
}


When this dialog is closed, I highlight ReportCtrl in this manner:
// This is part of the function mapped to the ID_OPEN_RECORD message:
...
MyDialog.DoModal(); // makes View lose focus - it goes to the navigation Tree View on the left
ReportCtrl.SetFocus(); // Get back lost focus - if this line is removed, problem goes away, but then
// user loses focus
....


Unfortunately, this has an odd effect; When I press return in the child dialog, the dialog's default button, OK, is pressed, but then "the enter" somehow propogates down to CMyFormView, causing the dialog to immediately respawn - That's obviously not desirable. What should I do? How can I make the Right pane/ CFormView get back focus without this happening?

For some reason, directly calling the function mapped to the ID_OPEN_RECORD Message, or Sending rather than posting a message, causes assertion failures. I didn't make the ID_OPEN_RECORD especially to solve this problem though - It was originally created so that the user could press an "open record" button on the toolbar, and have that work in every view.

Regards,
Sternocera
QuestionC++ MySQL without libmysql Pin
aceralex30-Jul-08 0:35
aceralex30-Jul-08 0:35 
AnswerRe: C++ MySQL without libmysql Pin
Sternocera30-Jul-08 1:26
Sternocera30-Jul-08 1:26 
GeneralRe: C++ MySQL without libmysql Pin
aceralex30-Jul-08 1:39
aceralex30-Jul-08 1:39 
GeneralRe: C++ MySQL without libmysql Pin
Mark Salsbery30-Jul-08 6:56
Mark Salsbery30-Jul-08 6:56 
GeneralRe: C++ MySQL without libmysql Pin
enhzflep30-Jul-08 16:28
enhzflep30-Jul-08 16:28 
GeneralRe: C++ MySQL without libmysql Pin
Mark Salsbery31-Jul-08 7:37
Mark Salsbery31-Jul-08 7:37 
GeneralRe: C++ MySQL without libmysql Pin
enhzflep31-Jul-08 14:39
enhzflep31-Jul-08 14:39 
GeneralRe: C++ MySQL without libmysql Pin
Mark Salsbery31-Jul-08 15:34
Mark Salsbery31-Jul-08 15:34 
QuestionVK_BACK is not working when button is clicked [Solved] Pin
ShilpiP30-Jul-08 0:17
ShilpiP30-Jul-08 0:17 
GeneralRe: VK_BACK is not working when button is clicked Pin
Matthew Faithfull30-Jul-08 0:23
Matthew Faithfull30-Jul-08 0:23 
AnswerRe: VK_BACK is not working when button is clicked Pin
_AnsHUMAN_ 30-Jul-08 0:26
_AnsHUMAN_ 30-Jul-08 0:26 
GeneralRe: VK_BACK is not working when button is clicked Pin
ShilpiP30-Jul-08 1:22
ShilpiP30-Jul-08 1:22 
GeneralRe: VK_BACK is not working when button is clicked Pin
_AnsHUMAN_ 30-Jul-08 1:47
_AnsHUMAN_ 30-Jul-08 1:47 
GeneralRe: VK_BACK is not working when button is clicked Pin
ShilpiP30-Jul-08 2:00
ShilpiP30-Jul-08 2:00 
Questionusing iostream header Pin
Mushtaque Nizamani29-Jul-08 23:36
Mushtaque Nizamani29-Jul-08 23:36 
AnswerRe: using iostream header Pin
CPallini29-Jul-08 23:41
mveCPallini29-Jul-08 23:41 
QuestionUnresolved external symbol question Pin
monsieur_jj29-Jul-08 23:12
monsieur_jj29-Jul-08 23:12 

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.