473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Selecting which form to load using command line parameters

6
I am working on debugging a multithreaded network application. I have two forms. One of which is my testing form, the other is the actual user form. I need to be able to load only my testing form when testing and then load my other form. I was thinking i could do this using command line parameters but i'm not sure where to put my code. If anyone has any idea on how i could accomplish this it would very helpful.

Expand|Select|Wrap|Line Numbers
  1. Sub Main()
  2.     Dim a_strArgs() As String
  3.     Dim strFilename As String
  4.     Dim i As Integer
  5.  
  6.     a_strArgs = Split(Command$, " ")
  7.     For i = LBound(a_strArgs) To UBound(a_strArgs)
  8.         Select Case LCase(a_strArgs(i))
  9.  
  10.             Case "-t", "/t"
  11.                 testingform.Show()
  12.  
  13.             Case "-m", "/m"
  14.                 mainform.show()
  15.  
  16.             Case Else
  17.                 MsgBox("Invalid argument: " & a_strArgs(i))
  18.         End Select
  19.  
  20.     Next i
  21. End Sub
Mar 10 '08 #1
1 1618
Killer42
8,435 Expert 8TB
What you've got seems fine to me. What's the problem with it?

Um... assuming this is VB6, you might have forgotten to set the startup object to "Sub Main" under the Project Properties.
Mar 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
4
by: Sami | last post by:
I hope someone will tell me how to do this without having to do any VB as I know nothing in that area. I am a rank beginner in using Access. I have created a database consisting of student...
0
by: Frank 'Olorin' Rizzi | last post by:
Hello everyone. This is quite convoluted, but I'll try to make it simple. I have a couple of bottom-line questions (I guess): 1~ what happens between the Page_Load routine in the code behind...
6
by: Joe | last post by:
Hi, I have a MS Access DB in which a record has just too many fields to be able to allow users to do inline editing in a datagrid. So I want to display as First Name: Text box where first...
3
by: roy_ware | last post by:
I'm using a VB.Net interface to load an Access table. The relationship is 1 input record to many table rows. The problem is that the first name of the first row is populated for every row on the...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
1
by: vunderusaf | last post by:
I have a listbox on a form that is selecting using named FinalQuery: SELECT ., ., . FROM FinalQuery; Now I have a text field with a date on this form and I'd like to use that date as the...
0
by: pd123 | last post by:
I'm new to C# and .net and I'm trying to create a form that will register users in a sql server database. I have the following code but when I run the code I get an error " The name 'Peter' is...
4
by: db2admin | last post by:
Hello, If i import data into tables, import will write all warnings in message file and will tell me why any exception row is rejected. I wanted to get exception rows in seperate table which i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.