PDA

View Full Version : (int argc, char *argv[]) in windows


kk3z
07-09-2004, 20:26
è possibile passare comandi anche con programmi windows?

uso le win32 api e dev-c++ - sotto windows.

grazie :)

cipi
07-09-2004, 21:14
basta che richiami l'eseguibile da linea di comando!
;)

cionci
07-09-2004, 22:16
Per i programmi Win32 per console...non ci sono problemi perchè hai il main normale...
Per i programmi a finestre devi usare le API:
- da windows 2000 in su: GetCommandLineW da passare a CommandLineToArgvW
- per gli altri: GetCommandLine, ma ti devi processare tutta la stringa da solo...

Mi raccomando: "It is the caller's responsibility to free the memory used by the argument list when it is no longer needed. To free the memory, use a single call to the GlobalFree function."