Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starting win32 app with a variable

Status
Not open for further replies.

Malcav

Programmer
Oct 7, 2005
43
GB
Hi
I have unfortunatly inherited a large amount of code at work. and need to add the ability to start the program with a variable which will then load a persons information rather than selecting from alist. My experience is in c and c#.net not vc++ so I am slightly at a loss. cant even find the void main() {}
Sorry for such a vague noob question but I am at a loss.
 
1) If you're using Visual Studio, there is a "search files" icon that will let you search all the files in the project directory with one click. It looks like tiny binoculars.

2) Yes, you have to find main(argc, argv) and check to see if a parameter was passed.
 
Ok so I have stepped through the code and found that:
BOOL CProwin01App::InitInstance()
is the first thing in the code I have that runs. and in the assosiated h file there is the declaration of the class CProwin01App.
 
InitInstance is called by WinMain and the parameter list is accessable via
Code:
CWinApp::m_lpCmdLine

use
Code:
this->m_lpCmdLine
from inside your InitInstance function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top