Click here to Skip to main content
15,896,453 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: visual c++ executable file Pin
David Crow8-Sep-08 6:45
David Crow8-Sep-08 6:45 
GeneralRe: visual c++ executable file Pin
FrankMookie8-Sep-08 6:56
FrankMookie8-Sep-08 6:56 
Questionwho can give me a example in C++ using Factory Pattern Pin
york5288-Sep-08 6:06
york5288-Sep-08 6:06 
AnswerRe: who can give me a example in C++ using Factory Pattern Pin
Christian Graus8-Sep-08 6:26
protectorChristian Graus8-Sep-08 6:26 
GeneralRe: who can give me a example in C++ using Factory Pattern Pin
york5289-Sep-08 6:32
york5289-Sep-08 6:32 
AnswerRe: who can give me a example in C++ using Factory Pattern Pin
laksh22048-Sep-08 23:39
laksh22048-Sep-08 23:39 
GeneralRe: who can give me a example in C++ using Factory Pattern Pin
york5289-Sep-08 5:58
york5289-Sep-08 5:58 
QuestionParseCommandLine question Pin
sashoalm8-Sep-08 4:17
sashoalm8-Sep-08 4:17 
I'm using ParseCommandLine to read command line arguments. I give the command line in debug mode with Project->Settings->Program Arguments. But ParseCommandLine thinks there are no args. I've seen the contents of m_lpCmdLine, and it correctly shows the args as I've given them.


So I step into ParseCommandLine, and it goes here:
void CWinApp::ParseCommandLine(CCommandLineInfo& rCmdInfo)
{
	for (int i = 1; i < __argc; i++)
	{
		LPCTSTR pszParam = __targv[i];
		BOOL bFlag = FALSE;
		BOOL bLast = ((i + 1) == __argc);
		if (pszParam[0] == '-' || pszParam[0] == '/')
		{
			// remove flag specifier
			bFlag = TRUE;
			++pszParam;
		}
		rCmdInfo.ParseParam(pszParam, bFlag, bLast);
	}
}

But it never enters the cycle - __argc is 0. Confused | :confused:

Interestingly, __argc is not a variable but a function, for argc it goes here
_CRTIMP int * __cdecl
AFNAME(__argc) (void)
{
        return AFRET(__argc);
}

And ParseCommandLine works in another project from which I copied/pasted the code.

What might be causing this problem?
Thanks.

There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal

QuestionRe: ParseCommandLine question Pin
David Crow8-Sep-08 5:06
David Crow8-Sep-08 5:06 
AnswerRe: ParseCommandLine question Pin
sashoalm8-Sep-08 5:19
sashoalm8-Sep-08 5:19 
QuestionRe: ParseCommandLine question Pin
David Crow8-Sep-08 5:46
David Crow8-Sep-08 5:46 
AnswerRe: ParseCommandLine question Pin
sashoalm8-Sep-08 6:10
sashoalm8-Sep-08 6:10 
GeneralRe: ParseCommandLine question Pin
Mark Salsbery8-Sep-08 6:51
Mark Salsbery8-Sep-08 6:51 
AnswerRe: ParseCommandLine question Pin
sashoalm8-Sep-08 6:32
sashoalm8-Sep-08 6:32 
QuestionRe: ParseCommandLine question Pin
David Crow8-Sep-08 6:43
David Crow8-Sep-08 6:43 
AnswerRe: ParseCommandLine question Pin
sashoalm8-Sep-08 6:58
sashoalm8-Sep-08 6:58 
GeneralRe: ParseCommandLine question Pin
Mark Salsbery8-Sep-08 7:13
Mark Salsbery8-Sep-08 7:13 
JokeRe: ParseCommandLine question Pin
sashoalm8-Sep-08 7:18
sashoalm8-Sep-08 7:18 
GeneralRe: ParseCommandLine question Pin
Mark Salsbery8-Sep-08 7:23
Mark Salsbery8-Sep-08 7:23 
GeneralRe: ParseCommandLine question Pin
sashoalm8-Sep-08 7:53
sashoalm8-Sep-08 7:53 
GeneralRe: ParseCommandLine question Pin
Mark Salsbery8-Sep-08 7:59
Mark Salsbery8-Sep-08 7:59 
GeneralRe: ParseCommandLine question Pin
sashoalm8-Sep-08 8:56
sashoalm8-Sep-08 8:56 
GeneralRe: ParseCommandLine question Pin
Mark Salsbery8-Sep-08 9:15
Mark Salsbery8-Sep-08 9:15 
GeneralRe: ParseCommandLine question Pin
sashoalm8-Sep-08 21:43
sashoalm8-Sep-08 21:43 
GeneralRe: ParseCommandLine question Pin
Mark Salsbery9-Sep-08 5:06
Mark Salsbery9-Sep-08 5:06 

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.