views:

157

answers:

1

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?

+5  A: 

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.

anon
Oh,that's awful to have to parse myself.