Solved

Can't make VB6 program that uses argv

Posted on 2011-09-15
4
437 Views
Last Modified: 2012-06-27
I'm trying to make a VB6 project that uses a main subroutine whose first line declares it as follows:  Sub Main(ByRef argv() As String)

I need to be able to pick up command line arguments, but I get error message "Must have startup form or Sub Main()."  When I elimiante the argv reference, the project compiles.  How do I fix this?
0
Comment
Question by:thomsone
  • 3
4 Comments
 
LVL 11

Accepted Solution

by:
kbirecki earned 500 total points
ID: 36545610
Are you referring to command line arguments when you start the app?

You can pick those up using Command$, such as

Dim c as string
c = Command$

Then you can work with that string, either splitting by spaces, commas, whatever.
0
 
LVL 11

Expert Comment

by:kbirecki
ID: 36545619
You don't put arguments in the Sub Main() proc that defines your startup.
0
 

Author Closing Comment

by:thomsone
ID: 36545622
Thanks for the fast help!
0
 
LVL 11

Expert Comment

by:kbirecki
ID: 36545638
Happy to help.  
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question