Thiago R. Adams website

Home Code-Blog Projects Twitter Blog Links / Books About

Websites

Converting from WinMain to standard main

int main(int argc, TCHAR* argv[]);

int APIENTRY _tWinMain(HINSTANCE hInstance,
                       HINSTANCE hPrevInstance,
                       LPTSTR    lpCmdLine,
                       int       nCmdShow)
{   
   int nArgs;
   LPWSTR *szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);

   if (szArglist == NULL)
       return 1; //error
   
   const int r = main(nArgs, szArglist);
   LocalFree(szArglist);
   return r;   
}

Want to see more? Go to the CodeBlog section.

About the author: I am Thiago Adams. I work as a professional C++ software engineer. I have created this website to share ideas and source code with other people with similar interests.
I would like to hear from you comments, critics, questions and suggestions about this topic or any other part of this website. Email: thiago.adams at gmail dot com