secureswitools/makekeys/src/MAKEKEYS.CPP
branchRCL_3
changeset 25 7333d7932ef7
parent 1 c42dffbd5b4f
child 26 8b7f4e561641
--- a/secureswitools/makekeys/src/MAKEKEYS.CPP	Thu Aug 19 10:02:49 2010 +0300
+++ b/secureswitools/makekeys/src/MAKEKEYS.CPP	Tue Aug 31 15:21:33 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -56,7 +56,7 @@
 :m_fVerbose(FALSE)
 	{ ; }
 
-int CMakeKeys::Run(const int argc, const _TCHAR *argv[], const _TCHAR *envp[])
+int CMakeKeys::Run(const int argc, const _TCHAR *argv[])
 // Inputs   : argc, argv, envp - The command line passed to the process
 	{	
 	BOOL bValid = TRUE;
@@ -117,6 +117,7 @@
 
 			OUT << _T("Warning: the private key should be encrypted with the -password option") << endl;
 			OUT << _T("Do you want to use a password (y/n)? ");
+			OUT.flush();
 
 			cin >> Warn;
 
@@ -166,6 +167,7 @@
 
 				OUT << _T("Warning: the private key should be encrypted with the -password option") << endl;
 				OUT << _T("Do you want to use a password (y/n)? ");
+				OUT.flush();
 
 				cin >> Warn;
 
@@ -296,9 +298,13 @@
 	// main function - constructs a CMakeKeys object and calls it's run method
 	extern "C"
 		{
-		int _tmain(int argc, const _TCHAR *argv[], const _TCHAR *envp[])
+		int main(int argc, const char *argv[], const char *envp[])
 			{
+			// MingW doesn't support _tmain(),
+			// so using GetCommandLineW() to get wide args.
+			wchar_t** argvW = CommandLineToArgvW( GetCommandLineW(), &argc);
+			
 			CMakeKeys app;
-			return app.Run(argc, argv, envp);
+			return app.Run(argc, argvW);
 			}
 		}