Click here to Skip to main content
15,922,650 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Disable keyboard & mouse input Pin
Adam Roderick J29-Oct-09 20:07
Adam Roderick J29-Oct-09 20:07 
QuestionI need help figuring out this C++ Pin
halestorm 22229-Oct-09 18:29
halestorm 22229-Oct-09 18:29 
AnswerRe: I need help figuring out this C++ Pin
Adam Roderick J29-Oct-09 18:35
Adam Roderick J29-Oct-09 18:35 
QuestionRe: I need help figuring out this C++ Pin
David Crow30-Oct-09 3:36
David Crow30-Oct-09 3:36 
QuestionUnhandled exception in CreateCompatibleBitmap() Pin
tibbasultanpur29-Oct-09 18:26
tibbasultanpur29-Oct-09 18:26 
QuestionRe: Unhandled exception in CreateCompatibleBitmap() Pin
Adam Roderick J29-Oct-09 18:42
Adam Roderick J29-Oct-09 18:42 
AnswerRe: Unhandled exception in CreateCompatibleBitmap() Pin
tibbasultanpur29-Oct-09 18:56
tibbasultanpur29-Oct-09 18:56 
QuestionWhy no default constructor for property sheets? [modified] Pin
al250029-Oct-09 18:03
al250029-Oct-09 18:03 
Hi,

Usually I instantiate my CDialog based classes in my view class. Then CMyView class typically creates a modal dialog and then launches a function on OK from which I can easily access the dialog variables.

Unfortunately, the wizard implementation of CPropertySheet has no default constructor. So you are forced to construct it in the view function that is called from a toolbar menu or similar. Then the property page variables have to be duplicated in CMyView class and copied. I have 2 books that show it done this way.

Here is the wizard CPropertySheet constructor code-

CMyDlg::CMyDlg(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{

}

CMyDlg::CMyDlg(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{


And the constructor in CMyView looks like -

CMyDlg CMyDlg(_T("  "),this);

or

CMyDlg CMyDlg(_T("  "));

if (CMyDlg.DoModal() == IDOK){
//copy all property page variables to CMyView based variables


(both verified to work)

If I now add the appropriate default constructors to the PropertySheet .h and .cpp files -

CMyDlg();

CMyDlg::CMyDlg():CPropertySheet()
{
}


I then instantiate CMyDlg in the view class instead of constructing it in the menu function.

I don't get any compile errors but the dialog (property page) does not display when DoModal is called even though there is no run time error.

I suppose I should admit defeat and call the constructor as designed.

modified on Friday, October 30, 2009 12:55 AM

Question_utime problem Pin
crazydoy29-Oct-09 16:00
crazydoy29-Oct-09 16:00 
AnswerRe: _utime problem Pin
«_Superman_»29-Oct-09 16:56
professional«_Superman_»29-Oct-09 16:56 
GeneralRe: _utime problem Pin
crazydoy29-Oct-09 18:47
crazydoy29-Oct-09 18:47 
QuestionRe: _utime problem Pin
David Crow30-Oct-09 3:39
David Crow30-Oct-09 3:39 
QuestionTimerAPCProc() Not Being Called With SetWaitableTimer() Pin
Hummer209729-Oct-09 12:48
Hummer209729-Oct-09 12:48 
AnswerRe: TimerAPCProc() Not Being Called With SetWaitableTimer() Pin
Mauro Leggieri29-Oct-09 16:53
Mauro Leggieri29-Oct-09 16:53 
GeneralRe: TimerAPCProc() Not Being Called With SetWaitableTimer() Pin
Hummer209730-Oct-09 2:45
Hummer209730-Oct-09 2:45 
QuestionHow to read and write to a BINARY file? Pin
dipuks29-Oct-09 12:46
dipuks29-Oct-09 12:46 
AnswerRe: How to read and write to a BINARY file? Pin
Member 419459329-Oct-09 13:05
Member 419459329-Oct-09 13:05 
AnswerRe: How to read and write to a BINARY file? Pin
enhzflep29-Oct-09 13:06
enhzflep29-Oct-09 13:06 
GeneralRe: How to read and write to a BINARY file? Pin
dipuks29-Oct-09 15:27
dipuks29-Oct-09 15:27 
GeneralRe: How to read and write to a BINARY file? Pin
enhzflep29-Oct-09 15:53
enhzflep29-Oct-09 15:53 
AnswerRe: How to read and write to a BINARY file? Pin
David Crow29-Oct-09 17:01
David Crow29-Oct-09 17:01 
AnswerRe: How to read and write to a BINARY file? Pin
Adam Roderick J29-Oct-09 17:58
Adam Roderick J29-Oct-09 17:58 
QuestionA General Problem Pin
WindowsVsLinux29-Oct-09 8:49
WindowsVsLinux29-Oct-09 8:49 
AnswerRe: A General Problem Pin
«_Superman_»29-Oct-09 9:04
professional«_Superman_»29-Oct-09 9:04 
GeneralRe: A General Problem Pin
WindowsVsLinux29-Oct-09 18:03
WindowsVsLinux29-Oct-09 18:03 

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.