Tutorial :What's wrong with my using argc/argv this way in c?



Question:

This works:

int main( int argc, char *argv[])  {  ....  gtk_init(&argc, &argv);  ....  

But this doesn't:

int WINAPI WinMain (HINSTANCE p1, HINSTANCE p2, LPSTR argv, int argc) {   ....  gtk_init(&argc, &argv);  ....  

Can someone point out what's wrong there?


Solution:1

WinMain does not provide you with argc and argv - see http://msdn.microsoft.com/en-us/library/ms633559%28VS.85%29.aspx. You get the command line as a single string (the third parameter) which you have to parse yourself.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »