?
Solved

No main window

Posted on 2003-03-23
3
Medium Priority
?
259 Views
Last Modified: 2013-11-20
Hi experts,

I have written following simplest MFC program.
It has no problems in compiling as well as linking.
But when I run the program, I don't see any window.
Any problem in VC++ settings?
I am using VC++ 6.0 Enterprise Edition.

#include <afxwin.h>
class CMainWin : public CFrameWnd
{
public:
     CMainWin();
     DECLARE_MESSAGE_MAP()
};

CMainWin::CMainWin()
{
     Create(NULL,"MFC");
}
class CApp : public CWinApp
{
public:
     BOOL InitInstace();
};

BOOL CApp::InitInstace()
{
     m_pMainWnd=new CMainWin;
     m_pMainWnd->ShowWindow(m_nCmdShow);
     m_pMainWnd->UpdateWindow();
     return TRUE;
}
BEGIN_MESSAGE_MAP(CMainWin,CFrameWnd)
END_MESSAGE_MAP()
CApp App;
0
Comment
Question by:sumant032199
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 200 total points
ID: 8189682
Write InitInstance instead of InitInstace.
0
 
LVL 1

Expert Comment

by:keitha1
ID: 8191867
Good eyes, AlemFM
0
 
LVL 3

Author Comment

by:sumant032199
ID: 8194269
Thanks.

Virtual functions are nasty!
I spent 2 hours hunting the bug.
This example has confirmed that C++ does a lot many things
which programmer has not told it explicitely to do.

Thanks a lot, AlexFM.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month11 days, 23 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question