[grisbi-cvs] grisbi/src main.c,1.161,1.162

Gunee guneemwelloeux at users.sourceforge.net
Mon Jan 25 19:10:45 CET 2010


Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27514

Modified Files:
	main.c 
Log Message:
Win MSVC - Fixed argument passing to the main.
>> Fixes the "no icon problem" when grisbi is started with an empty working dir on Windows

Index: main.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/main.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -d -r1.161 -r1.162
--- main.c	23 Jan 2010 23:29:27 -0000	1.161
+++ main.c	25 Jan 2010 18:10:42 -0000	1.162
@@ -87,9 +87,13 @@
                      LPTSTR    lpCmdLine,
                      int       nCmdShow)
 {
-	int argc;
-	char ** argv;
-	argv = CommandLineToArgvW(GetCommandLineW(), &(argc));
+	int argc, nLen;
+	LPWSTR * argvP;
+	char ** argv = malloc(sizeof(char**));
+	argvP = CommandLineToArgvW(GetCommandLineW(), &(argc));
+	nLen = WideCharToMultiByte(CP_UTF8, 0,argvP[0], -1, NULL, NULL, NULL, NULL);
+	*argv = malloc((nLen + 1) * sizeof(char));
+	WideCharToMultiByte(CP_UTF8, NULL, argvP[0], -1, *argv, nLen, NULL, NULL);
 	return main(argc, argv);
 }
 #endif



More information about the cvs mailing list