Solved

Can't make VB6 program that uses argv

Posted on 2011-09-15
4
443 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 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Title # Comments Views Activity
bit defender blocks good applications 2 107
MS Access Search and Replace Using VBA 6 92
Access 2013 combo box not working 3 60
Automatic Email Reminder 4 78
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

696 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