Click here to Skip to main content
16,009,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Access vector from C# Pin
Joe Woodbury2-Dec-06 10:13
professionalJoe Woodbury2-Dec-06 10:13 
QuestionCEedit MFC question Pin
FredrickNorge2-Dec-06 1:55
FredrickNorge2-Dec-06 1:55 
AnswerRe: CEedit MFC question Pin
Eikthrynir2-Dec-06 2:45
Eikthrynir2-Dec-06 2:45 
GeneralRe: CEedit MFC question Pin
FredrickNorge2-Dec-06 3:35
FredrickNorge2-Dec-06 3:35 
AnswerRe: CEedit MFC question Pin
PJ Arends2-Dec-06 22:43
professionalPJ Arends2-Dec-06 22:43 
AnswerRe: CEedit MFC question Pin
ThatsAlok3-Dec-06 20:13
ThatsAlok3-Dec-06 20:13 
QuestionMemory leaks Pin
Eikthrynir2-Dec-06 1:45
Eikthrynir2-Dec-06 1:45 
AnswerRe: Memory leaks Pin
Mark Salsbery2-Dec-06 5:58
Mark Salsbery2-Dec-06 5:58 
For an MFC app, you don't need a _tmain() entry point. Use the CWinApp::InitInstance() and
CWinApp::ExitInstance() overrides for initialization and cleanup.

If you absolutely MUST have your own entry point then you'll need to look at the source code for
MFC's entry-point implementation and make sure you are covering all initialization and cleanup.

If the only reason you need to override the entry point is to check for memory leaks then
you can use a static object like your CWinApp object. I use this in my app module:
#ifdef _DEBUG
class _MemStateCheck
{
public:
	CMemoryState oldMemState, newMemState, diffMemState;
 
	_MemStateCheck();
	~_MemStateCheck();
};

_MemStateCheck::_MemStateCheck()
{
	oldMemState.Checkpoint();
}

_MemStateCheck::~_MemStateCheck()
{
	newMemState.Checkpoint();
	if( diffMemState.Difference( oldMemState, newMemState ) )
	{
		TRACE( "************************\n" );
		TRACE( "Memory leaks Detected\n" );
		TRACE( "************************\n" );
		diffMemState.DumpStatistics();
		diffMemState.DumpAllObjectsSince();
	}
	else
	{
		TRACE( "************************\n" );
		TRACE( "No memory leaks Detected\n" );
		TRACE( "************************\n" );
	}
}

_MemStateCheck MemCheckObj;
#endif  //#ifdef _DEBUG

GeneralRe: Memory leaks Pin
Eikthrynir2-Dec-06 7:58
Eikthrynir2-Dec-06 7:58 
AnswerRe: Memory leaks Pin
Joe Woodbury2-Dec-06 10:32
professionalJoe Woodbury2-Dec-06 10:32 
GeneralRe: Memory leaks Pin
Eikthrynir2-Dec-06 11:08
Eikthrynir2-Dec-06 11:08 
QuestionApplication Error. The Memory Could not be read Pin
B.Govindarajan2-Dec-06 1:41
B.Govindarajan2-Dec-06 1:41 
AnswerRe: Application Error. The Memory Could not be read Pin
Mark Salsbery2-Dec-06 6:08
Mark Salsbery2-Dec-06 6:08 
QuestionCFont does not work with CListCtrl [modified] Pin
cy163@hotmail.com1-Dec-06 21:42
cy163@hotmail.com1-Dec-06 21:42 
AnswerRe: CFont does not work with CListCtrl Pin
Makakuin1-Dec-06 21:48
Makakuin1-Dec-06 21:48 
GeneralRe: CFont does not work with CListCtrl Pin
cy163@hotmail.com1-Dec-06 21:54
cy163@hotmail.com1-Dec-06 21:54 
GeneralRe: CFont does not work with CListCtrl Pin
Makakuin1-Dec-06 22:00
Makakuin1-Dec-06 22:00 
AnswerRe: CFont does not work with CListCtrl Pin
Mark Salsbery2-Dec-06 6:03
Mark Salsbery2-Dec-06 6:03 
AnswerRe: CFont does not work with CListCtrl Pin
Joe Woodbury2-Dec-06 10:50
professionalJoe Woodbury2-Dec-06 10:50 
AnswerRe: CFont does not work with CListCtrl Pin
cy163@hotmail.com4-Dec-06 10:30
cy163@hotmail.com4-Dec-06 10:30 
QuestionSetting background color to the dialog box Pin
Taruni1-Dec-06 19:35
Taruni1-Dec-06 19:35 
AnswerRe: Setting background color to the dialog box Pin
Rajesh R Subramanian1-Dec-06 19:45
professionalRajesh R Subramanian1-Dec-06 19:45 
AnswerRe: Setting background color to the dialog box Pin
Joe Woodbury2-Dec-06 10:52
professionalJoe Woodbury2-Dec-06 10:52 
QuestionCombo box help Pin
celllllllll1-Dec-06 11:58
celllllllll1-Dec-06 11:58 
AnswerRe: Combo box help Pin
Mark Salsbery1-Dec-06 12:05
Mark Salsbery1-Dec-06 12:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.