?
Solved

Can't make VB6 program that uses argv

Posted on 2011-09-15
4
Medium Priority
?
461 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 11

Accepted Solution

by:
kbirecki earned 2000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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