Another VB Hidden Feature?

  • Thread starter Thread starter CJ Taylor
  • Start date Start date
C

CJ Taylor

Whats up everyone,

I was playing around with some C# last night and noticed something
interesting. I built two programs, one VB and one C#. Each had 1 form with
nothing on it.

However, the C# form has this

void sub main() {
Application.Run (Form1)
}

So does VB.NET automatically add this in at compile time, kinda like the
default constructor thing?

-CJ
 
Hi CJ,

Are you never looking what Armin is saying, he told this hundred times in
this newsgroup.
He uses the words behind the scene.

:-)

Cor
 
CJ,
Yes this is added, however I would not liken it to the default constructor
thing per se.

You can use ILDASM.EXE to see what (IL) code is generated by VB.NET when
compiles your program.

Hope this helps
Jay
 
Cor said:
Hi CJ,

Are you never looking what Armin is saying, he told this hundred times in
this newsgroup.

It's part of a conspiracy agaisnt Armin... =)

My apologies, must have missed it or selectivly read it until I actually saw
it. =) Sorry armin.

-CJ
 
* "CJ Taylor said:
I was playing around with some C# last night and noticed something
interesting. I built two programs, one VB and one C#. Each had 1 form with
nothing on it.

However, the C# form has this

void sub main() {
Application.Run (Form1)
}

So does VB.NET automatically add this in at compile time, kinda like the
default constructor thing?

Yes, something similar (you can have a look at it using "ILDASM.EXE").
Nevertheless, you can define the 'Main' method yourself (in a module or
as a shared method in a class) and select 'Sub Main' as startup object
in the project's properties dialog.
 
Back
Top