Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

argc argv in winmain

Status
Not open for further replies.

ThomasGGiusepe

Computer
Oct 11, 2003
3
Hi there,

How to get argc and argv with winmain ?

Thanks!
Tom
 
Replies continue below

Recommended for you

This comes out of an ancient copy of VC++:

int PASCAL WinMain(hinstCurrent, hinstPrevious, lpCmdLine, nCmdShow)

HINSTANCE hinstCurrent; /* handle of current instance */
HINSTANCE hinstPrevious; /* handle of previous instance */
LPSTR lpszCmdLine; /* address of command line */
int nCmdShow; /* show-window type (open/icon) */


The WinMain function is called by the system as the initial entry point for a Windows application.

Parameter Description

hinstCurrent Identifies the current instance of the application.
hinstPrevious Identifies the previous instance of the application.
lpszCmdLine Points to a null-terminated string specifying the command line for the application.
 
I've implemented it about 5 days ago. Thanks for your feedback anyway. Best wishes.
 
Well, how did you do that?
I want to use the getopt module in order to retrieve the arguments out of the command-line. How can I do that?
As I see it, there are 2 options:
1. Get the argv/argc and use getopt.
2. Use some mechanism on Windows that I don't know about.

Erez
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor