Click here to Skip to main content
15,924,039 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: _AfxCheckDialogTemplate Pin
Don Box17-Jan-08 20:00
Don Box17-Jan-08 20:00 
GeneralRe: _AfxCheckDialogTemplate Pin
Hencil15-Jun-10 2:04
Hencil15-Jun-10 2:04 
GeneralExecute a function using command line parameters. Pin
CodingLover17-Jan-08 18:58
CodingLover17-Jan-08 18:58 
GeneralRe: Execute a function using command line parameters. Pin
Don Box17-Jan-08 19:59
Don Box17-Jan-08 19:59 
GeneralRe: Execute a function using command line parameters. Pin
CPallini17-Jan-08 21:05
mveCPallini17-Jan-08 21:05 
GeneralRe: Execute a function using command line parameters. Pin
CodingLover17-Jan-08 21:49
CodingLover17-Jan-08 21:49 
GeneralRe: Execute a function using command line parameters. Pin
CPallini17-Jan-08 22:04
mveCPallini17-Jan-08 22:04 
GeneralRe: Execute a function using command line parameters. Pin
CodingLover17-Jan-08 22:34
CodingLover17-Jan-08 22:34 
CPallini wrote:
if it isn't static, then you have to create an instance of the class:


Yes it is, all my members are public. So I use an instance there.

As you said set the arguments. But it not display any...

int _tmain(int argc, _TCHAR* argv[])
{
	// srgc - Argument counter
	// srgv - Argument vector

// Instance
	CAdd m_Add;

// Argument check
	if(argc < 2)
	{
		cout << "Less" << endl;
		return EXIT_FAILURE;	// used RTL
	}

// Select the function
	int n;
	n = atoi(argv[1]);

	switch(n)
	{
		case 1:
			//func1();
			m_Add.addNumbers();
		break;
		case 2:
			//func2();
			m_Add.diffNumbers();
		break;
		default:
			cout << "Invalid argument" << endl;
		break;
	}

	cin.get();
    return 0;
}


I think this correct. Smile | :)

I appreciate your help all the time...
Eranga Smile | :)

QuestionRe: Execute a function using command line parameters. Pin
CPallini17-Jan-08 22:46
mveCPallini17-Jan-08 22:46 
GeneralRe: Execute a function using command line parameters. Pin
CodingLover17-Jan-08 22:54
CodingLover17-Jan-08 22:54 
GeneralRe: Execute a function using command line parameters. Pin
CPallini17-Jan-08 23:00
mveCPallini17-Jan-08 23:00 
GeneralRe: Execute a function using command line parameters. Pin
CodingLover17-Jan-08 23:03
CodingLover17-Jan-08 23:03 
GeneralRe: Execute a function using command line parameters. Pin
CPallini17-Jan-08 23:09
mveCPallini17-Jan-08 23:09 
GeneralRe: Execute a function using command line parameters. Pin
CodingLover22-Jan-08 18:41
CodingLover22-Jan-08 18:41 
GeneralRe: Execute a function using command line parameters. [modified] Pin
CPallini22-Jan-08 21:15
mveCPallini22-Jan-08 21:15 
GeneralRe: Execute a function using command line parameters. Pin
CodingLover22-Jan-08 21:41
CodingLover22-Jan-08 21:41 
GeneralRe: Execute a function using command line parameters. Pin
CPallini22-Jan-08 21:49
mveCPallini22-Jan-08 21:49 
GeneralRe: Execute a function using command line parameters. Pin
CodingLover22-Jan-08 22:14
CodingLover22-Jan-08 22:14 
GeneralOpening a running process programmatically Pin
lctrncs17-Jan-08 18:46
lctrncs17-Jan-08 18:46 
GeneralRe: Opening a running process programmatically Pin
Iain Clarke, Warrior Programmer18-Jan-08 2:34
Iain Clarke, Warrior Programmer18-Jan-08 2:34 
GeneralRe: Opening a running process programmatically Pin
Member 75496018-Jan-08 7:37
Member 75496018-Jan-08 7:37 
GeneralFull screen stop function Pin
gentleguy17-Jan-08 17:48
gentleguy17-Jan-08 17:48 
GeneralRe: Full screen stop function Pin
Hamid_RT17-Jan-08 17:56
Hamid_RT17-Jan-08 17:56 
GeneralRe: Full screen stop function Pin
gentleguy17-Jan-08 18:04
gentleguy17-Jan-08 18:04 
GeneralRe: Full screen stop function Pin
Nishad S17-Jan-08 19:38
Nishad S17-Jan-08 19:38 

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.