|
-
Aug 10th, 2006, 06:22 AM
#1
Thread Starter
New Member
Passing parameter to a VB6 Application
I want to pass a parameter to the VB executable file, and depending upon that parameter a particular form will open. Please guide
-
Aug 10th, 2006, 06:31 AM
#2
Re: Passing parameter to a VB6 Application
You are looking for comman line arguments. In VB the command line arguments that are passed from the command line are stored in Command$ string. Here is a simple example
VB Code:
Public Sub Main()
If Command$ = "Form1" Then
Form1.Show
ElseIf Command$ = "Form2" Then
Form2.Show
End If
End Sub
I am assuming that the startup object will be SubMain and there are already two Forms present in project.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Aug 10th, 2006, 06:37 AM
#3
Re: Passing parameter to a VB6 Application
@Anik_sinha
Welcome on the forums
@Shuja Ali
what is the use of pasing parameter
-
Aug 10th, 2006, 06:44 AM
#4
Re: Passing parameter to a VB6 Application
Its like using switches in some application....for example with the pkzip utility you can the -t switch to test the zip files and something else...same like with excel.exe, notepad.exe, winword.exe if you type the file name with full path the application will be opened with the specified file name
if you type Excel.Exe C:\SomeDir\SomeFile.xls in the Run window excel will open excel with the specified file....
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Aug 10th, 2006, 06:57 AM
#5
Re: Passing parameter to a VB6 Application
-
Aug 10th, 2006, 07:23 AM
#6
Re: Passing parameter to a VB6 Application
Here is a nice tutorial on Command Line Arguments.
-
Aug 10th, 2006, 07:27 AM
#7
Re: Passing parameter to a VB6 Application
good example by ipranks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|