Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 22nd, 2005, 07:04 AM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default how can i get parameters passed to a vb exe

how can i get such parameters, like when i type in Run "mspaint C:\something.bmp"

 
Old January 22nd, 2005, 12:18 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Check this :: http://www.experts-exchange.com/Prog..._20987464.html

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old January 23rd, 2005, 02:27 AM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

from what i've seen, i need a payd membership to view the solution...
 
Old January 23rd, 2005, 11:37 AM
Authorized User
 
Join Date: Jan 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To get the param passed to an exe in VB6 use the command function

Put the code into the form load sub

dim Parm as string
Parm = command$
msgbox Parm

hope that helps.

When ya dreams come true.
 
Old January 24th, 2005, 12:11 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Extract from that site:

In VB6 goto Project menu - Project Properties - and on the "Make" Tab and specify the command line parameter.

You can get whatever has been passed to your app by using Command$ reserved variable. Then just parse the command line.

Private Sub Form_Load()
 If Command$ <> " " then
       If InStr(Command$, "?") > 0 Then
             ShowHelp
       End If
 End If
Ens Sub

This will check if the /? switch was included.

Command Function

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

When Visual Basic is launched from the command line, any portion of the command line that follows /cmd is passed to the program as the command-line argument. In the following example, cmdlineargs represents the argument information returned by the Command function.

VB /cmd cmdlineargs

For applications developed with Visual Basic and compiled to an .exe file, Command returns any arguments that appear after the name of the application on the command line. For example:

MyApp cmdlineargs

ref: http://msdn.microsoft.com/library/de...fctCommand.asp

Also see: http://msdn.microsoft.com/library/de...ommandline.asp

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a VB 2005 exe file on a system without VB dilionyi Pro Visual Basic 2005 3 September 21st, 2009 07:37 PM
How to check the parameters passed to web method? karveajit ASP.NET 1.0 and 1.1 Professional 3 December 20th, 2006 05:55 PM
sql parameters not passed or received redeye2 Pro VB.NET 2002/2003 1 November 5th, 2004 07:10 PM
VB Exe triggering another EXE moiyed Beginning VB 6 2 November 6th, 2003 11:48 PM
Spawning a VB EXE from another EXE alantkilzer VB How-To 3 July 30th, 2003 07:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.