NO

Author Topic: CommandLineToArgv routine  (Read 2790 times)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1769
CommandLineToArgv routine
« on: April 21, 2014, 06:43:05 pm »
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  ;)
« Last Edit: April 22, 2014, 12:50:21 am by frankie »

Offline Vortex

  • Member
  • *
  • Posts: 529
    • http://www.vortex.masmcode.com
Re: CommandLineToArgv routine
« Reply #1 on: April 21, 2014, 09:27:17 pm »
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...

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1769
Re: CommandLineToArgv routine
« Reply #2 on: April 21, 2014, 10:25:13 pm »
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)
« Last Edit: April 21, 2014, 10:27:16 pm by frankie »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1899
Re: CommandLineToArgv routine
« Reply #3 on: April 22, 2014, 08:12:08 am »
Nice work.
May the source be with you