cdialog

Is it normal for an hwnd to have its high bit set?

北城以北 提交于 2019-12-12 05:38:15
问题 I'm passing my HWND to a sub-process so it can send me messages back on its progress. Occasionally I never receive any messages from the sub-process. While investigating, I've found that GetSafeHwnd() of which I'm passing to the subprocess seems to be returning values I don't expect. For example: 0xffffffffa5400382 Based on that, I can probably deduce that I'm not properly converting that value to/from an int64/string properly. I can fix that. But what I find odd is that this hwnd just doesn

Avoid Flickering on a dialog that moves its controls on resize

懵懂的女人 提交于 2019-12-12 01:28:19
问题 I have a popup dialog( CDialog ) that handles WM_CTLCOLOR message to color itself. It is having some controls (like bitmap buttons) that draws themselves using OwnerDraw. It is also having a control that displays an image with size that takes up to 70% of the dialog. When user re-sizes the dialog, some of the controls in the dialog should be re-positioned (not re-sized) . It also involves re-sizing of the image inside the dialog. As the re-sizing of image makes the whole process slow,

CMFCMenuButton does not close

不羁岁月 提交于 2019-12-08 05:40:42
问题 I have a CDialog with a CFMCMenuButton . when I open it, everything appears normally: The problem happens when I click somewhere else to close the menu. The menu seems unclosable, unless user selects an option of it. And if I press Escape on the keyboard, the dialog closes itself, which is too drastic; I really would want it to close only the menu. I know I could solve this by setting its property "OS Menu" in the resource file to True (or equivalently, assigning its property m_bOSMenu= TRUE

Problems using CDialogEx class that don't occur when using the CDialog class

馋奶兔 提交于 2019-12-08 01:35:59
问题 1.- H ello. After searching in a lot of sites and forums all this week I found the point of the problem I was having. The problem is that when I create a New MFC project in Visual C++, if I set the Application type as "Dialog Based" and let the respective dialog class derive from its default CDialogEx, then the problem shows immediately compiling and executing the program without modifying any of the code (I don't know if you could try this in your machine). 2.-The wired behavior is that with

CMFCMenuButton does not close

浪尽此生 提交于 2019-12-07 08:43:23
I have a CDialog with a CFMCMenuButton . when I open it, everything appears normally: The problem happens when I click somewhere else to close the menu. The menu seems unclosable, unless user selects an option of it. And if I press Escape on the keyboard, the dialog closes itself, which is too drastic; I really would want it to close only the menu. I know I could solve this by setting its property "OS Menu" in the resource file to True (or equivalently, assigning its property m_bOSMenu= TRUE ). And I would get: As you can see in the image, the consequences are : I loose the icons (not very

Difference between CDialog and CDialogEx

走远了吗. 提交于 2019-12-07 04:21:22
问题 What is the difference between CDialog and CDialogEx? I decided to use CDialog because I can't assign m_pMainWnd to Dlg if Dlg is derived from CDialogEx. BOOL CPreparationApp::InitInstance() { MyClass2 Dlg; //derived from CDialog m_pMainWnd = &Dlg; Dlg.DoModal(); return TRUE; } What kind of problems I might fave by not using CDialogEx like form wizard was offering? How to assign m_pMainWnd variable derived from CDialogEx? 回答1: CDialogEX is derived from CDialog, so, setting m_pMainWnd to a

How to display a non-modal CDialog?

你。 提交于 2019-12-05 16:14:49
问题 Can someone tell me how I could create a Non Modal Dialog in MFC's Visual c++ 6.0 and show it? I wrote this code: CDialog dialog; if (dialog.init(initialization values...)) dialog.DoModal(); But it blocks my application from showing the dialog. I dont know if there exists any method or other way to do it. Thanks 回答1: /* CChildDialog class is inherited from CDialog */ CChildDialog *m_pDialog = NULL; // Invoking the Dialog m_pDialog = new CChildDialog(); if (m_pDialog != NULL) { BOOL ret = m

Difference between CDialog and CDialogEx

ⅰ亾dé卋堺 提交于 2019-12-05 11:09:32
What is the difference between CDialog and CDialogEx? I decided to use CDialog because I can't assign m_pMainWnd to Dlg if Dlg is derived from CDialogEx. BOOL CPreparationApp::InitInstance() { MyClass2 Dlg; //derived from CDialog m_pMainWnd = &Dlg; Dlg.DoModal(); return TRUE; } What kind of problems I might fave by not using CDialogEx like form wizard was offering? How to assign m_pMainWnd variable derived from CDialogEx? CDialogEX is derived from CDialog, so, setting m_pMainWnd to a CDialogEx derived object should not be a problem. CDialogEx provides the abillity to set the background color

CDialog::Create fails for dialog with ActiveX control

萝らか妹 提交于 2019-12-01 06:06:52
I have a module that creates a modeless dialog containing an ActiveX control. This module was part of an MFC EXE application and the creation of the dialog worked fine. Recently, I moved the module out into an ATL/COM server and copied the dialog resource from the EXE into the COM server. When trying to create the modeless dialog using CDialog::Create() an error happens. I debugged into CDialog::Create and noticed that it fails in ::CreateDialogIndirect() which returns NULL and GetLastError returns 0 . I changed the "No Fail Create" flag to True in the dialog resource properties and I get more

CDialog::Create fails for dialog with ActiveX control

筅森魡賤 提交于 2019-12-01 03:39:42
问题 I have a module that creates a modeless dialog containing an ActiveX control. This module was part of an MFC EXE application and the creation of the dialog worked fine. Recently, I moved the module out into an ATL/COM server and copied the dialog resource from the EXE into the COM server. When trying to create the modeless dialog using CDialog::Create() an error happens. I debugged into CDialog::Create and noticed that it fails in ::CreateDialogIndirect() which returns NULL and GetLastError