Command$ value disappears

Posted by AngryHacker on Stack Overflow See other posts from Stack Overflow or by AngryHacker
Published on 2010-04-13T00:42:28Z Indexed on 2010/04/13 0:52 UTC
Read the original article Hit count: 383

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 the 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).

© Stack Overflow or respective owner

Related posts about vb6

Related posts about command-line-arguments