开发者

Command$ value disappears

开发者 https://www.devze.com 2022-12-27 04:12 出处:网络
I have a VB6 app.I am trying to figure out what command line parameters got passed into the application.If I type in ? Command$ into the Immediate window, it prints out the command line params fine.Sa

I have a VB6 app. I am trying to figure out what command line parameters got passed into the application. If I type in ? Command$ into the Immediate window, it prints out the command line params fine. Same, if I place Command$ into the Watch window.

However, if I assign the Command$ function to a string:

Dim s as string 
s = Command$

the s variable will be empty.

What am I missing here?

I should mention that t开发者_StackOverflow社区he code in question is located not in the main form, but in a DLL 2 levels down (e.g. the form calls DLL1, then DLL1 calls DLL2).


Pretty sure the GetCommandLine() API would be an alternative (it should work for anything thats in-process with the executable) so you could try that instead of Command$.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号