Solved

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

Posted on 1997-01-21
1
454 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
[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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.

726 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