PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Application initialization event?
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Application initialization event?
![]() |
Application initialization event? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I need to program a one-time application initialization event for a windows
form app, similar to what one might do in global.asa were one programming a web app. Our scenario is that we are using .NET remoting with a Win32 client to a remote HTTP server. I need to invoke the remoting.config file once per user session. Were this a web app, we would simply program Application_OnStart as follows: Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) RemotingConfiguration.Configure(HttpContext.Current.Request.PhysicalApplicat ionPath & "\remoting.config") End Sub Is there an equivalent global event for Win32? Which files do I have to add to my Win32 client project? TIA. mark |
|
|
|
#2 |
|
Guest
Posts: n/a
|
"Mark Peters" <mcpdoc@hotmail.com> schrieb:
>I need to program a one-time application initialization event for a windows > form app, similar to what one might do in global.asa were one programming > a > web app. Add this code to a module file and select 'Sub Main' as startup object in the project properties: \\\ Public Module Program Public SubMain(ByVal Args() As String) For Each Arg As String In Args Console.WriteLine(Arg) Next Arg End Sub End Module /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Execution of winforms applications is straightforward. There more than one
places where you can put your initialization code: 1. In the main method, before Application.Run method code 2. In the main form costructor 3. Handling Form.Load event (or alternatively overriding Form's OnLoad virtual method) -- Stoitcho Goutsev (100) [C# MVP] "Mark Peters" <mcpdoc@hotmail.com> wrote in message news:O07ARw4ZFHA.3096@TK2MSFTNGP15.phx.gbl... >I need to program a one-time application initialization event for a windows > form app, similar to what one might do in global.asa were one programming > a > web app. > > Our scenario is that we are using .NET remoting with a Win32 client to a > remote HTTP server. I need to invoke the remoting.config file once per > user > session. Were this a web app, we would simply program Application_OnStart > as follows: > > Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) > > RemotingConfiguration.Configure(HttpContext.Current.Request.PhysicalApplicat > ionPath & "\remoting.config") > > End Sub > > > Is there an equivalent global event for Win32? Which files do I have to > add > to my Win32 client project? > > TIA. > mark > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

