showwindow
-
This may be a simple thing but I,m stuck. In the last function of this class I am trying to show m_image_new. This is not for a serious project I am just learning, but the project will not compile. The class is:- // dlg_new.cpp : implementation file // #include "stdafx.h" #include "EditTest.h" #include "dlg_new.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // dlg_new dialog dlg_new::dlg_new(CWnd* pParent /*=NULL*/) : CDialog(dlg_new::IDD, pParent) { //{{AFX_DATA_INIT(dlg_new) m_image_new = _T(""); //}}AFX_DATA_INIT } void dlg_new::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(dlg_new) DDX_Control(pDX, IDC_BUTTON_IMAGE, m_image_button); DDX_Text(pDX, IDC_STATIC_IMAGE, m_image_new); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(dlg_new, CDialog) //{{AFX_MSG_MAP(dlg_new) ON_COMMAND(ID_VIEW_NEW, OnViewNew) ON_BN_CLICKED(IDC_BUTTON_IMAGE, OnButtonImage) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // dlg_new message handlers void dlg_new::OnViewNew() { // TODO: Add your command handler code here } void dlg_new::OnButtonImage() { //using ::CWnd; m_image_new.CWnd::ShowWindow( SW_SHOW ); // TODO: Add your control notification handler code here } The error I get is that CWnd is not a member of CString. Please help regards Paul
-
This may be a simple thing but I,m stuck. In the last function of this class I am trying to show m_image_new. This is not for a serious project I am just learning, but the project will not compile. The class is:- // dlg_new.cpp : implementation file // #include "stdafx.h" #include "EditTest.h" #include "dlg_new.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // dlg_new dialog dlg_new::dlg_new(CWnd* pParent /*=NULL*/) : CDialog(dlg_new::IDD, pParent) { //{{AFX_DATA_INIT(dlg_new) m_image_new = _T(""); //}}AFX_DATA_INIT } void dlg_new::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(dlg_new) DDX_Control(pDX, IDC_BUTTON_IMAGE, m_image_button); DDX_Text(pDX, IDC_STATIC_IMAGE, m_image_new); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(dlg_new, CDialog) //{{AFX_MSG_MAP(dlg_new) ON_COMMAND(ID_VIEW_NEW, OnViewNew) ON_BN_CLICKED(IDC_BUTTON_IMAGE, OnButtonImage) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // dlg_new message handlers void dlg_new::OnViewNew() { // TODO: Add your command handler code here } void dlg_new::OnButtonImage() { //using ::CWnd; m_image_new.CWnd::ShowWindow( SW_SHOW ); // TODO: Add your control notification handler code here } The error I get is that CWnd is not a member of CString. Please help regards Paul
-
This may be a simple thing but I,m stuck. In the last function of this class I am trying to show m_image_new. This is not for a serious project I am just learning, but the project will not compile. The class is:- // dlg_new.cpp : implementation file // #include "stdafx.h" #include "EditTest.h" #include "dlg_new.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // dlg_new dialog dlg_new::dlg_new(CWnd* pParent /*=NULL*/) : CDialog(dlg_new::IDD, pParent) { //{{AFX_DATA_INIT(dlg_new) m_image_new = _T(""); //}}AFX_DATA_INIT } void dlg_new::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(dlg_new) DDX_Control(pDX, IDC_BUTTON_IMAGE, m_image_button); DDX_Text(pDX, IDC_STATIC_IMAGE, m_image_new); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(dlg_new, CDialog) //{{AFX_MSG_MAP(dlg_new) ON_COMMAND(ID_VIEW_NEW, OnViewNew) ON_BN_CLICKED(IDC_BUTTON_IMAGE, OnButtonImage) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // dlg_new message handlers void dlg_new::OnViewNew() { // TODO: Add your command handler code here } void dlg_new::OnButtonImage() { //using ::CWnd; m_image_new.CWnd::ShowWindow( SW_SHOW ); // TODO: Add your control notification handler code here } The error I get is that CWnd is not a member of CString. Please help regards Paul
Stirfie wrote: I am trying to show m_image_new what do you mean ??? i think m_image_new is a CString variable and i completely don't understand what you're trying to do with this :
m_image_new.CWnd::ShowWindow( SW_SHOW );
"Go as far as you can see,and when you get there you’ll see further" - Unknown
-
Try GetDlgItem(IDC_STATIC_IMAGE)->ShowWindow(SW_SHOW); instead of m_image_new.CWnd::ShowWindow( SW_SHOW );