|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
win ap with argumentsHi EveryBody:
How can I make windows application project start with arguments and return a variable. Thanks for your help "raulavi" <raul***@discussions.microsoft.com> schrieb: Which part of your question stayed unanswered?> How can I make windows application project start with arguments and return > a > variable. <URL:http://www.google.de/groups?selm=B3C3CB08-6388-40B9-8CC8-7EF97EC5645A%40microsoft.com> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Thanks Herfried:
this is now what I got to solve... I have a windows application which is myApp.EXE starting as Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load .... end also have a paint method Private Sub me_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint 'must have Imports System.Drawing.Drawing2D Dim Canvas As Graphics = e.Graphics ...lots of code end sub I need to call myApp.exe from another.exe and pass arguments and receive a return value... what changes do I need to make to myApp.exe. Thanks Show quoteHide quote "Herfried K. Wagner [MVP]" wrote: > "raulavi" <raul***@discussions.microsoft.com> schrieb: > > How can I make windows application project start with arguments and return > > a > > variable. > > Which part of your question stayed unanswered? > > <URL:http://www.google.de/groups?selm=B3C3CB08-6388-40B9-8CC8-7EF97EC5645A%40microsoft.com> > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > >
Show quote
Hide quote
"raulavi" <raul***@discussions.microsoft.com> schrieb: Add a new module to the project:> this is now what I got to solve... > > > I have a windows application which is myApp.EXE starting as > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles MyBase.Load > .... > end > also have a paint method > Private Sub me_Paint(ByVal sender As Object, ByVal e As > System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint > 'must have Imports System.Drawing.Drawing2D > Dim Canvas As Graphics = e.Graphics > ...lots of code > end sub > > > I need to call myApp.exe from another.exe and > pass arguments and receive a return value... > what changes do I need to make to myApp.exe. \\\ Public Module Program Public Function Main(ByVal Args() As String) As Integer For Each Arg As String In Args MsgBox(Arg) Next Arg Application.Run(New MainForm()) If...Then Return 1 Else Return 2 ... End If End Function End Module /// Select 'Sub Main' as startup object in the project properties. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Thanks.
Show quoteHide quote "Herfried K. Wagner [MVP]" wrote: > "raulavi" <raul***@discussions.microsoft.com> schrieb: > > this is now what I got to solve... > > > > > > I have a windows application which is myApp.EXE starting as > > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles MyBase.Load > > .... > > end > > also have a paint method > > Private Sub me_Paint(ByVal sender As Object, ByVal e As > > System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint > > 'must have Imports System.Drawing.Drawing2D > > Dim Canvas As Graphics = e.Graphics > > ...lots of code > > end sub > > > > > > I need to call myApp.exe from another.exe and > > pass arguments and receive a return value... > > what changes do I need to make to myApp.exe. > > Add a new module to the project: > > \\\ > Public Module Program > Public Function Main(ByVal Args() As String) As Integer > For Each Arg As String In Args > MsgBox(Arg) > Next Arg > Application.Run(New MainForm()) > If...Then > Return 1 > Else > Return 2 > ... > End If > End Function > End Module > /// > > Select 'Sub Main' as startup object in the project properties. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > |
|||||||||||||||||||||||