Click here to Skip to main content
15,885,855 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all, I was given a project to covert a VB application to VB.NET type. It went on well and there was no error after solving certain minor issues related to DLL.

My question is I found a command that was commented to receive the process id. I was totally unsure of this. The command goes like this.

string strProcessId = VB.Command()


The string was expected to receive a process_ID, but it never does and always displayed as an empty string.

I am not bothered about the process now.
All I wanted to know is what does the command VB.Command() returns?
Posted

According to Microsoft :

"Returns the argument portion of the command line used to launch Microsoft Visual Basic or an executable program developed with Visual Basic."

If you launch your app :
YourApp.exe 12345
It returns "12345"

Cheers
 
Share this answer
 
Comments
Dalek Dave 25-Oct-10 4:04am    
Also can be used to fire back to Excel.
NaveenSoftwares 25-Oct-10 8:00am    
Hi Dave, can you brief it for me with an example.
It all depends on what object is VB?

AFAIK, VB is not a standard object that we can tell you looking at the line. You need to see and find about VB type first and then a simple Google can tell you about the command.
 
Share this answer
 
Comments
NaveenSoftwares 25-Oct-10 7:59am    
It is a statndard object in Vb. You can create in any VB project.
Here the VB as you said is an import which imports vb comands.
Hi Estys,
The problem is the command always returns NULL in any sample project. Can you brief your explanation more.

My sample app goes like this in .NET

messagebox.show(vb.command())

the result is empty messagebox

My sample app in VB is
msgbox(Command())

which is also an empty messagebox.
 
Share this answer
 
Comments
Estys 25-Oct-10 3:45am    
If you don't start your app with arguments, the string will be empty. If you run it from within the IDE, you can set an argument-property of the project IIRC.
Estys 25-Oct-10 3:50am    
I don't know if it works the same way in VB.NET, my remarks were towards the VB6 function.
NaveenSoftwares 25-Oct-10 5:06am    
Thanks!. I got it to some Extend.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900