CommandLineToArgv routine

Started by frankie, April 21, 2014, 06:43:05 PM

Previous topic - Next topic

frankie

I needed a routine to mimic command line arguments packing.
Windows offers CommandLineToArgvW, that works only with unicode, but, most rilevant, is not compatible with MS guidelines reported here  >:(
Something is available on the net, but still not compliant.
So I wrote it... 8)

EDIT: I forget to evaluate the tab as separator. Fixed  ;)
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Vortex

Hi Frankie,

It depends on what are you trying to achieve. My small C run-time library does not follow the standards of that guideline but it meets my requirements. As an alternative, did you try the __getmainargs function exported by msvcrt.dll ?

http://msdn.microsoft.com/en-us/library/ff770599.aspx
Code it... That's all...

frankie

#2
Thanks Vortex  :D
Well the rules from MS have a sense: they allows you to pass device or network paths even with embedded spaces (they have more backslashes before any char).  ;)
That's why I wrote this one by myself that is it fully compliant ...  8)
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

TimoVJL

May the source be with you