Solved

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

Posted on 1997-01-21
1
401 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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now