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. FrameWIndow Creation Problem

FrameWIndow Creation Problem

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
2 Posts 2 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.
  • G Offline
    G Offline
    ganesh_IT
    wrote on last edited by
    #1

    Hi guys, I am writing project for bank operation in MFC, before running my application i have to check the username and password. But i have some problem in my code, my main frame window is closed after enter username and password.Any one tell me the reason.....

    class CLoginDialog : public CDialog //MyDialog class
    {
    //Mycode
    };

    ///////////////////////Frame class////////////////////

    CBankFrameWnd : public CFrameWnd
    {
    //Mycode
    };
    /////////////////////////App class////////////////

    class CBankApp : public CWinApp
    {
    public:
    CBankApp();
    ~CBankApp();
    BOOL InitInstance();
    };

    CBankApp::CBankApp
    {
    }
    CBankApp::~CBankApp()
    {
    }
    BOOL CBankApp::InitInstance()
    {
    CLoginDialog *pDlg = new CLoginDialog();
    m_pMainWnd = pDlg;
    if(pDlg->DoModal() == IDOK)
    {
    //Verify userName password,
    if Valid User then assign frame window in m_pMainwnd and return TRUE ...
    CBankFrameWnd *pWnd = new CBankFrameWnd();
    m_pMainWnd = pWnd;
    pWnd -> ShowWindow(m_nCmdShow);
    pWnd -> UpdateWindow();
    return TRUE;
    }
    else
    return FALSE;
    }

    Thanks in Advance

    E 1 Reply Last reply
    0
    • G ganesh_IT

      Hi guys, I am writing project for bank operation in MFC, before running my application i have to check the username and password. But i have some problem in my code, my main frame window is closed after enter username and password.Any one tell me the reason.....

      class CLoginDialog : public CDialog //MyDialog class
      {
      //Mycode
      };

      ///////////////////////Frame class////////////////////

      CBankFrameWnd : public CFrameWnd
      {
      //Mycode
      };
      /////////////////////////App class////////////////

      class CBankApp : public CWinApp
      {
      public:
      CBankApp();
      ~CBankApp();
      BOOL InitInstance();
      };

      CBankApp::CBankApp
      {
      }
      CBankApp::~CBankApp()
      {
      }
      BOOL CBankApp::InitInstance()
      {
      CLoginDialog *pDlg = new CLoginDialog();
      m_pMainWnd = pDlg;
      if(pDlg->DoModal() == IDOK)
      {
      //Verify userName password,
      if Valid User then assign frame window in m_pMainwnd and return TRUE ...
      CBankFrameWnd *pWnd = new CBankFrameWnd();
      m_pMainWnd = pWnd;
      pWnd -> ShowWindow(m_nCmdShow);
      pWnd -> UpdateWindow();
      return TRUE;
      }
      else
      return FALSE;
      }

      Thanks in Advance

      E Offline
      E Offline
      Eugen Podsypalnikov
      wrote on last edited by
      #2

      Maybe the constructor of the window does not create it ? :)

      virtual void BeHappy() = 0;

      modified on Friday, September 24, 2010 2:19 AM

      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