How to pass arguments to MFC app?

Hi.
I understand that I can pass them and parse them at "ProcessShellCommand", my question is:
Suppose I got the arguement, how can I pass it to Document and store it there so I can access it from every View??
Thanks.
[244 byte] By [Shvalb] at [2007-11-20 11:53:07]
# 1 Re: How to pass arguments to MFC app?
This is covered here: How to process command line arguments in a MFC application? ( http://www.dev-archive.com/forum/showthread.php?t=386406)

Laitinen
laitinen at 2007-11-11 4:02:26 >
# 2 Re: How to pass arguments to MFC app?
Ok, thanks!

but more important for me is how to pass those parameters to the Document so I can have access to them from any view??
Shvalb at 2007-11-11 4:03:31 >
# 3 Re: How to pass arguments to MFC app?
Create a variable in your document class, then create a set method for this variable.

For example:

bool someBool;

void setBool(bool b)
{
someBool = b;
}

Then in InitInstance (in your CWinApp derived class), last thing you do is:

((CYourView*)((CFrameWnd*)AfxGetMainWnd())->GetActiveView())->GetDocument()->setBool(false);

Laitinen
laitinen at 2007-11-11 4:04:29 >
# 4 Re: How to pass arguments to MFC app?
Thanks.

Already did it using : AfxGetApp()

Thanks alot.
Shvalb at 2007-11-11 4:05:35 >