Solved

Can't make VB6 program that uses argv

Posted on 2011-09-15
4
430 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

943 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now