Solved

How to replace WinMain() of MFC with my own...

Posted on 1997-01-21
1
435 Views
Last Modified: 2013-11-20
As we know, WinMain() function in MFC application is prepared by MFC itself and linked into the code automatically.  This implies, that even we only want to use DAO/WinSock object, a CWinApp class instance is required.  Such constraint is very inconvenient for us because we don't want to use the whole MFC framework (we just want to make use of DAO...).

I think it's common problem for MFC programmers.  Thus, could anyone give me your experience about "HOW TO REPLACE MFC'S WinMain() WITH YOUR OWN ONE"?
0
Comment
Question by:chcheng
1 Comment
 

Accepted Solution

by:
jmp012097 earned 50 total points
ID: 1300574
I'm afraid that even if you replace WinMain, you would still have to play the game of MFC and use a CWinApp class.

CWinApp implements the message loop. You would have to do it yourself (including idle time handling to update your user interface). I'm pretty sure most other features will assert if they can't find an application object.

My advice is to stick with the App class, but do not create document and view objects. If you statically link your application, you should get a light .EXE (if you can assume that your customers all have the DLL version of MFC, this is even better of course).

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

825 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