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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problem Showing a window with MFC

Problem Showing a window with MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
5 Posts 4 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.
  • A Offline
    A Offline
    andybougard
    wrote on last edited by
    #1

    Hi everyone: I´m just starting with visual c++ 2008 and have put some code for showing a window, the code don't send any error message... the thing is that when i run it, it don't show at all... can someone help please?? thanks!! Code:

    #include <afxwin.h>

    class COurApp: public CWinApp
    {
    public:
    virtual BOOL IntInstance();
    };

    class COurWnd: public CFrameWnd
    {
    public:
    COurWnd()
    {
    Create(0,L"Ventana con MFC");
    }
    };

    BOOL COurApp::IntInstance(void)
    {
    m_pMainWnd=new COurWnd;
    m_pMainWnd->ShowWindow(m_nCmdShow);
    return TRUE;
    }
    COurApp AnApplication;

    J S 2 Replies Last reply
    0
    • A andybougard

      Hi everyone: I´m just starting with visual c++ 2008 and have put some code for showing a window, the code don't send any error message... the thing is that when i run it, it don't show at all... can someone help please?? thanks!! Code:

      #include <afxwin.h>

      class COurApp: public CWinApp
      {
      public:
      virtual BOOL IntInstance();
      };

      class COurWnd: public CFrameWnd
      {
      public:
      COurWnd()
      {
      Create(0,L"Ventana con MFC");
      }
      };

      BOOL COurApp::IntInstance(void)
      {
      m_pMainWnd=new COurWnd;
      m_pMainWnd->ShowWindow(m_nCmdShow);
      return TRUE;
      }
      COurApp AnApplication;

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      Use the MFC app wizard. Seriously. It's not worth dinking around with it manually.

      1 Reply Last reply
      0
      • A andybougard

        Hi everyone: I´m just starting with visual c++ 2008 and have put some code for showing a window, the code don't send any error message... the thing is that when i run it, it don't show at all... can someone help please?? thanks!! Code:

        #include <afxwin.h>

        class COurApp: public CWinApp
        {
        public:
        virtual BOOL IntInstance();
        };

        class COurWnd: public CFrameWnd
        {
        public:
        COurWnd()
        {
        Create(0,L"Ventana con MFC");
        }
        };

        BOOL COurApp::IntInstance(void)
        {
        m_pMainWnd=new COurWnd;
        m_pMainWnd->ShowWindow(m_nCmdShow);
        return TRUE;
        }
        COurApp AnApplication;

        S Offline
        S Offline
        sthalasayanam
        wrote on last edited by
        #3

        Check the function name InitInstance(). If it is misspelt, there will be no window.

        C A 2 Replies Last reply
        0
        • S sthalasayanam

          Check the function name InitInstance(). If it is misspelt, there will be no window.

          C Offline
          C Offline
          Cool_Dev
          wrote on last edited by
          #4

          As sthalasayanam told, if everything is correct and you are able to build the project successfully, then definitely the problem is with 'misspelled InitInstance' ;P

          1 Reply Last reply
          0
          • S sthalasayanam

            Check the function name InitInstance(). If it is misspelt, there will be no window.

            A Offline
            A Offline
            andybougard
            wrote on last edited by
            #5

            Ups.... That was it.... thankyou very much pals! problem solved XD

            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