Régis Ramillien
2006-02-20 13:01:47 UTC
Hi everybody,
I'm a new user of ClanLib (0.8 RC1 then RC2) and I had a little problem
with the function 'calc_commandline' which is in the WinMain.
When I launch an application, the program launch an exception.
I don't need args for the moment, so I have commented it, but I wonder
why you don't use the windows specific function 'CommandLineToArgvW' ?
It seem we don't need this huge 'calc_commandline' function, and with a combination of
"GetCommandLineW" and "CommandLineToArgvW" we can do the same in 2 lines...
If you are interested, I join below a very small example.
-------------------------------------------------------------
#ifdef _WIN32
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
int argc;
char** argv = (char**) CommandLineToArgvW(GetCommandLineW(), &argc);
#else
int main(int argc, char** argv) {
#endif
//ClanLib Main code
//...
retval = CL_ClanApplication::app->main(argc, argv);
//...
}
I'm a new user of ClanLib (0.8 RC1 then RC2) and I had a little problem
with the function 'calc_commandline' which is in the WinMain.
When I launch an application, the program launch an exception.
I don't need args for the moment, so I have commented it, but I wonder
why you don't use the windows specific function 'CommandLineToArgvW' ?
It seem we don't need this huge 'calc_commandline' function, and with a combination of
"GetCommandLineW" and "CommandLineToArgvW" we can do the same in 2 lines...
If you are interested, I join below a very small example.
-------------------------------------------------------------
#ifdef _WIN32
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
int argc;
char** argv = (char**) CommandLineToArgvW(GetCommandLineW(), &argc);
#else
int main(int argc, char** argv) {
#endif
//ClanLib Main code
//...
retval = CL_ClanApplication::app->main(argc, argv);
//...
}