Win32 API command line arguments parsing

前端 未结 9 2471
小蘑菇
小蘑菇 2020-12-16 13:52

I\'m writing Win32 console application, which can be started with optional arguments like this:

app.exe /argName1:\"argValue\" /argName2:\"argValue\"
         


        
9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-16 14:40

    The only support that Win32 provides for command line arguments are the functions GetCommandLine and CommandLineToArgvW. This is exactly the same as the argv parameter that you have for a console application.

    You will have to do the parsing yourself. Regex would be a good option for this.

提交回复
热议问题