Click here to Skip to main content
15,913,836 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Indeed. Pin
Rajesh R Subramanian16-Jul-08 0:51
professionalRajesh R Subramanian16-Jul-08 0:51 
GeneralRe: Indeed. Pin
CPallini16-Jul-08 1:43
mveCPallini16-Jul-08 1:43 
AnswerRe: How to write a game called"globule beats brick"using VC++6.0 or Visual Studio 2003 in SDI? Pin
Eytukan12-Jun-08 6:36
Eytukan12-Jun-08 6:36 
AnswerRe: How to write a game called"globule beats brick"using VC++6.0 or Visual Studio 2003 in SDI? Pin
youareabigboy13-Jun-08 3:28
youareabigboy13-Jun-08 3:28 
GeneralRe: How to write a game called"globule beats brick"using VC++6.0 or Visual Studio 2003 in SDI? Pin
Nelek12-Jun-08 5:44
protectorNelek12-Jun-08 5:44 
AnswerRe: How to write a game called"globule beats brick"using VC++6.0 or Visual Studio 2003 in SDI? Pin
bulg12-Jun-08 14:20
bulg12-Jun-08 14:20 
GeneralRe: How to write a game called"globule beats brick"using VC++6.0 or Visual Studio 2003 in SDI? Pin
bulg12-Jun-08 14:21
bulg12-Jun-08 14:21 
QuestionWhy CWinApp in a Win32 console Pin
BadKarma12-Jun-08 2:12
BadKarma12-Jun-08 2:12 
Hi, i'm currious,

I'm writing a winnt service application.
So I start of with a basic win32 console application.
There is not a CWinApp in the main file just the _tmain function.
#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
	return 0;
}

Then I remembered that i need some MFC classes or at least the support for it.
I recreate the project, but now i check out the option to include standard MCF headers.

Now i get:
<code>CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;

	// initialize MFC and print and error on failure
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
	{
		// TODO: change error code to suit your needs
		_tprintf(_T("Fatal Error: MFC initialization failed\n"));
		nRetCode = 1;
	}
	else
	{
		// TODO: code your application's behavior here.
	}
	return nRetCode;
}</code>


Why is this? The CWinApp object theApp is never used. What does it do?

Any insights would be appreciated.

Learn from the mistakes of others, you may not live long enough to make them all yourself.

AnswerRe: Why CWinApp in a Win32 console Pin
Graham Bradshaw12-Jun-08 2:40
Graham Bradshaw12-Jun-08 2:40 
AnswerRe: Why CWinApp in a Win32 console [modified] Pin
Nibu babu thomas12-Jun-08 2:45
Nibu babu thomas12-Jun-08 2:45 
Questioncouldn't install vc++ 2008? Pin
gentleguy12-Jun-08 1:56
gentleguy12-Jun-08 1:56 
QuestionRe: couldn't install vc++ 2008? Pin
CPallini12-Jun-08 2:39
mveCPallini12-Jun-08 2:39 
AnswerRe: couldn't install vc++ 2008? Pin
theCPkid12-Jun-08 3:06
theCPkid12-Jun-08 3:06 
AnswerRe: couldn't install vc++ 2008? Pin
Mark Salsbery12-Jun-08 6:11
Mark Salsbery12-Jun-08 6:11 
GeneralRe: couldn't install vc++ 2008? Pin
led mike12-Jun-08 6:48
led mike12-Jun-08 6:48 
QuestionHow to search and delete a file Pin
Shirani12-Jun-08 1:18
Shirani12-Jun-08 1:18 
AnswerRe: How to search and delete a file Pin
_AnsHUMAN_ 12-Jun-08 1:44
_AnsHUMAN_ 12-Jun-08 1:44 
AnswerRe: How to search and delete a file Pin
vijay_aroli12-Jun-08 2:36
vijay_aroli12-Jun-08 2:36 
GeneralRe: How to search and delete a file Pin
Shirani12-Jun-08 6:39
Shirani12-Jun-08 6:39 
GeneralRe: How to search and delete a file Pin
Eytukan12-Jun-08 7:52
Eytukan12-Jun-08 7:52 
QuestionAfxCallWndProc and custom control development Pin
sawerr12-Jun-08 1:11
sawerr12-Jun-08 1:11 
QuestionHow can I get byte pointers to give CString values ? Pin
SherTeks12-Jun-08 0:56
SherTeks12-Jun-08 0:56 
AnswerRe: How can I get byte pointers to give CString values ? Pin
SandipG 12-Jun-08 2:09
SandipG 12-Jun-08 2:09 
GeneralRe: How can I get byte pointers to give CString values ? Pin
RockyJames12-Jun-08 2:12
RockyJames12-Jun-08 2:12 
GeneralRe: How can I get byte pointers to give CString values ? Pin
SandipG 12-Jun-08 2:16
SandipG 12-Jun-08 2:16 

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.