473,405 Members | 2,262 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,405 software developers and data experts.

Sub Main not being executed in complied program

Hi there,

I've written a Programm which shall be started with or without Parameters. Without Parameters, a setup-form is loaded, with Parameters, a FTP-Transfer-form is loaded. I've included a Sub main-procedure and deactivated the Framework and everything works fine but only within the IDE. If I start the compiled exe-file, the Sub main is noz executed.
Here's the code:
Expand|Select|Wrap|Line Numbers
  1. Public Sub Main()
  2.         Dim lDoSetup As Boolean = False
  3.         Dim aCom As String() = Environment.GetCommandLineArgs
  4.         If aCom.Length > 0 Then
  5.             If aCom.Length = 1 Then
  6.                 If Debugger.IsAttached Then
  7.                     lDoSetup = True
  8.                 End If
  9.             End If
  10.         Else
  11.             lDoSetup = True
  12.         End If
  13.  
  14.         If lDoSetup Then
  15.             MsgBox("Setup ist True")
  16.         End If
  17.  
  18.         If lDoSetup Then
  19.             Application.Run(New SetupFRM)
  20.         Else
  21.             Application.Run(New FTPFRM(aCom))
  22.         End If
  23.     End Sub
  24.  
so when called without Parameters, SetupFRM should be loaded but isn't. So it seems that this code is not executed but FTPFRM loaded when the exe is started(I forgot to mention above, that Sub main is selected as start-object)
Hay anybody any idea what might cause this.

Best regards

Thomas
Jan 20 '16 #1
1 1106
Problem is solved. There are two Errors:

1. Msgbox is not being shown. I use messagebox.show.instead.
2. There is always a first commandline-arg containig the program-Name. So the setup-form has never been called.

Best regards

Thomas
Jan 20 '16 #2

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

Similar topics

3
by: penguinman | last post by:
Its just a hello world program. Compile and build goes with no warning or error. i type ./a.out and the shell just sits there. It doesnt hang but it just sits there with no output. I executed...
5
by: Henry Jordon | last post by:
hello I was wondering if someone could help me get a main going on this project I've completed the header file that the professor started us on but not really sure how to get the main going. If...
5
by: Seong-Kook Shin | last post by:
Hi, I'm reading Steve's "C Programming FAQs" in book version, and have two question regarding to Q11.16 ... Also, a `return' from `main' cannot be expected to work if data local to main might be...
13
by: robinsonreyna | last post by:
Hi everyone Is it possible to write a program which do not have a main() function. The program should compile and run. Please give sample code to do this.
2
by: Jeroen | last post by:
Here's the situation. My program will be able to start with an argument (a path to a file) and then run a batch of commands in that file. So if an argument is provided to the main method, the...
2
by: sirichennupati | last post by:
hi all, #include<stdlib.h> #include<iostream.h> void main() { cout<<"main1234\n"; system("perl perlsample.pl"); cout<<"invoked"; }
3
by: haelly | last post by:
Write a program that prompts the user to enter three different integer values.If the values are not different, the program prints a message"equal values" and terminates(hint: use the return...
1
by: haelly | last post by:
write a program that prompts the user to enter three different positive integer values.If the values are not different, the program prints a message"equal value" and terminates(hint:use the return...
1
by: altaey | last post by:
Question Details: Write a program to find and print a Fibonacci sequence of numbers. The Fibonacci sequence is defined as follow: Fn = Fn-2 + Fn-1, n >= 0 F0 = 0, F1 = 1, F2 = 1 Your...
8
by: Chris Winton | last post by:
Hello I'm having difficulty calling functions from the main section of my program here. What I am trying to do is call the addition function below and add the two arrays Q and R together. When the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.