From: Miro on
After clicking on the "View Application Events"...I think I found what I
wanted by registering the dll in the Startup

Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As
Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles
Me.Startup

Seems to work ok...

Miro



"Miro" <miro(a)beero.com> wrote in message
news:uqmkT65NKHA.1236(a)TK2MSFTNGP05.phx.gbl...
> Thanks FamilyTreeMike, that worked.
> I can now put a 'debugger' stop on my code and it works.
>
> One side question,
>
> If I have to Register a dll....
>
> Do I have to put it into the "SUB MAIN", in which case I must uncheck "use
> application framework" ?
> Are there any big drawbacks to unchecking "use application framework"?
>
> Thanks,
>
> Miro
>
>
> "Family Tree Mike" <FamilyTreeMike(a)ThisOldHouse.com> wrote in message
> news:uIpXxlzNKHA.1280(a)TK2MSFTNGP04.phx.gbl...
>> Miro wrote:
>>> I am trying to follow the following example:
>>>
>>> http://www.getdotnetcode.com/GdncStore/free/Articles/VB%20NET%20Sub%20Main%20Procedure.htm
>>> on adding things to my own 'sub main'.
>>>
>>> I created a form project and added Form1 and Form2 to the project.
>>>
>>> Then in the project property's the startup form is setup as form1. ( i
>>> have the option of Form1 or Form2 ).
>>>
>>> How do I get rid of the options in the setup to have a startup form?,
>>> and where to I setup the 'StartupForm' to hit the subMain() here.
>>>
>>> When I go to the <MainForm>Form1</MainForm> of the Application.myapp
>>> file and remove it, I get an error that no startup form has been
>>> specified.
>>>
>>> My objective is to set form2 to be the startup form
>>>
>>> Thanks,
>>>
>>> Miro
>>
>> Go to the project properties and at the application tab, uncheck "Enable
>> Application Framework". Now, "Sub Main" should be an option.
>>
>> This is using VB 2008 Express, so your mileage may vary...
>>
>> --
>> Mike
>

From: Alex Clark on
Miro,

See inline replies:

"Miro" <miro(a)beero.com> wrote in message
news:uqmkT65NKHA.1236(a)TK2MSFTNGP05.phx.gbl...
> Thanks FamilyTreeMike, that worked.
> I can now put a 'debugger' stop on my code and it works.
>
> One side question,
>
> If I have to Register a dll....
>
> Do I have to put it into the "SUB MAIN", in which case I must uncheck "use
> application framework" ?

I wouldn't put it in any part of the application itself, I'd do it as part
of an installer process. Putting that code into the application is likely
to cause UAC prompts on Win Vista/7 as your app will need elevated rights to
perform that action. If you're talking about a utility for personal use
it's probably no big deal, but if you're talking about a corporate app or
something you're selling to desktop users, I wouldn't recommend it.

> Are there any big drawbacks to unchecking "use application framework"?

Personally I never use it and have never missed any of the functionality; I
always prefer to take control from the exact entry point (i.e. Sub Main)
rather than assigning start up forms.

HTH,
Alex


From: Miro on
What about using the application events and put it into the startup?
Or you are saying you would still just put it into the main form's Public
Sub New() just after the initialize component?



"Alex Clark" <quanta(a)noemail.noemail> wrote in message
news:eVUuun7NKHA.5488(a)TK2MSFTNGP02.phx.gbl...
> Miro,
>
> See inline replies:
>
> "Miro" <miro(a)beero.com> wrote in message
> news:uqmkT65NKHA.1236(a)TK2MSFTNGP05.phx.gbl...
>> Thanks FamilyTreeMike, that worked.
>> I can now put a 'debugger' stop on my code and it works.
>>
>> One side question,
>>
>> If I have to Register a dll....
>>
>> Do I have to put it into the "SUB MAIN", in which case I must uncheck
>> "use application framework" ?
>
> I wouldn't put it in any part of the application itself, I'd do it as part
> of an installer process. Putting that code into the application is likely
> to cause UAC prompts on Win Vista/7 as your app will need elevated rights
> to perform that action. If you're talking about a utility for personal
> use it's probably no big deal, but if you're talking about a corporate app
> or something you're selling to desktop users, I wouldn't recommend it.
>
>> Are there any big drawbacks to unchecking "use application framework"?
>
> Personally I never use it and have never missed any of the functionality;
> I always prefer to take control from the exact entry point (i.e. Sub Main)
> rather than assigning start up forms.
>
> HTH,
> Alex
>
>

From: Family Tree Mike on
Miro wrote:
> What about using the application events and put it into the startup?
> Or you are saying you would still just put it into the main form's
> Public Sub New() just after the initialize component?
>
>
>

You probably should not be registering dlls (for COM, I presume), unless
you are writing a setup application. What is the scenario where you
want to register a dll at application startup?

--
Mike
From: Patrice on
Another option could be :
http://msdn.microsoft.com/en-us/library/ms973913.aspx

Basically you can use a COM dll without registering it...

Generally a DLL is registered at setup time as it usually requires admin
rights...

--
Patrice



"Miro" <miro(a)beero.com> a �crit dans le message de groupe de discussion :
uqmkT65NKHA.1236(a)TK2MSFTNGP05.phx.gbl...
> Thanks FamilyTreeMike, that worked.
> I can now put a 'debugger' stop on my code and it works.
>
> One side question,
>
> If I have to Register a dll....
>
> Do I have to put it into the "SUB MAIN", in which case I must uncheck "use
> application framework" ?
> Are there any big drawbacks to unchecking "use application framework"?
>
> Thanks,
>
> Miro
>
>
> "Family Tree Mike" <FamilyTreeMike(a)ThisOldHouse.com> wrote in message
> news:uIpXxlzNKHA.1280(a)TK2MSFTNGP04.phx.gbl...
>> Miro wrote:
>>> I am trying to follow the following example:
>>>
>>> http://www.getdotnetcode.com/GdncStore/free/Articles/VB%20NET%20Sub%20Main%20Procedure.htm
>>> on adding things to my own 'sub main'.
>>>
>>> I created a form project and added Form1 and Form2 to the project.
>>>
>>> Then in the project property's the startup form is setup as form1. ( i
>>> have the option of Form1 or Form2 ).
>>>
>>> How do I get rid of the options in the setup to have a startup form?,
>>> and where to I setup the 'StartupForm' to hit the subMain() here.
>>>
>>> When I go to the <MainForm>Form1</MainForm> of the Application.myapp
>>> file and remove it, I get an error that no startup form has been
>>> specified.
>>>
>>> My objective is to set form2 to be the startup form
>>>
>>> Thanks,
>>>
>>> Miro
>>
>> Go to the project properties and at the application tab, uncheck "Enable
>> Application Framework". Now, "Sub Main" should be an option.
>>
>> This is using VB 2008 Express, so your mileage may vary...
>>
>> --
>> Mike
>
>