Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. showwindow

showwindow

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++debugginglearning
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stirfie
    wrote on last edited by
    #1

    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

    P L 2 Replies Last reply
    0
    • S Stirfie

      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

      P Offline
      P Offline
      P Rex
      wrote on last edited by
      #2

      Try GetDlgItem(IDC_STATIC_IMAGE)->ShowWindow(SW_SHOW); instead of m_image_new.CWnd::ShowWindow( SW_SHOW );

      S 1 Reply Last reply
      0
      • S Stirfie

        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

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • P P Rex

          Try GetDlgItem(IDC_STATIC_IMAGE)->ShowWindow(SW_SHOW); instead of m_image_new.CWnd::ShowWindow( SW_SHOW );

          S Offline
          S Offline
          Stirfie
          wrote on last edited by
          #4

          Thanks, this worked. Regards Paul

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups