Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 1997-01-21
1
Medium Priority
?
484 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 100 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

597 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