Home All Groups Group Topic Archive Search About

win ap with arguments

Author
11 Apr 2005 7:03 PM
raulavi
Hi EveryBody:

How can I make windows application project start with arguments and return a
variable.

Thanks for your help

Author
11 Apr 2005 8:39 PM
Herfried K. Wagner [MVP]
"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/>
Author
11 Apr 2005 9:59 PM
raulavi
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/>
>
>
Author
11 Apr 2005 11:02 PM
Herfried K. Wagner [MVP]
Show quote Hide quote
"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/>
Author
12 Apr 2005 4:08 PM
raulavi
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/>
>