Hi

I have a third party telephony app that can inform of the any incoming call
tel number by one of two methods;

a) It can run a windows app with tel number passed as parameter, or

b) It can run a vbscript with tel number passed as parameter to the script.

My question is how can I design a vb.net app so that it can accept one of
the above techniques to pick the incoming tel number when needed.

Thanks

Regards

Re: App design advise by Tom

Tom
Wed Apr 23 15:01:24 CDT 2008

On 2008-04-23, John <info@nospam.infovis.co.uk> wrote:
> Hi
>
> I have a third party telephony app that can inform of the any incoming call
> tel number by one of two methods;
>
> a) It can run a windows app with tel number passed as parameter, or
>
> b) It can run a vbscript with tel number passed as parameter to the script.
>
> My question is how can I design a vb.net app so that it can accept one of
> the above techniques to pick the incoming tel number when needed.
>
> Thanks
>
> Regards
>
>

If your asking how to get command line parameters, then in VB.NET you
have several choices....

Use a main method as your startup object:

Sub Main(ByVal args() As String)
Function Main(ByVal args() As String) As Integer

The function Main lets you return a value to the OS.

Or, you can use:

Command
My.Application.CommandLineArgs
System.Environment.CommandLine
System.Environment.GetCommandLineArgs()

So you have lots of choices. The right one depends on your application
really. If you are going to use the VB.NET application framework, then
you will not want to use the Main method - but, use one of the other
options.

--
Tom Shelton

Re: App design advise by John

John
Wed Apr 23 15:09:07 CDT 2008

Wouldn't a new instance of .net app be run on each incoming call resulting
in multiple copies of app running?

Thanks

Regards

"Tom Shelton" <tom_shelton@YOUKNOWTHEDRILLcomcast.net> wrote in message
news:ejxDQzXpIHA.3408@TK2MSFTNGP03.phx.gbl...
> On 2008-04-23, John <info@nospam.infovis.co.uk> wrote:
>> Hi
>>
>> I have a third party telephony app that can inform of the any incoming
>> call
>> tel number by one of two methods;
>>
>> a) It can run a windows app with tel number passed as parameter, or
>>
>> b) It can run a vbscript with tel number passed as parameter to the
>> script.
>>
>> My question is how can I design a vb.net app so that it can accept one of
>> the above techniques to pick the incoming tel number when needed.
>>
>> Thanks
>>
>> Regards
>>
>>
>
> If your asking how to get command line parameters, then in VB.NET you
> have several choices....
>
> Use a main method as your startup object:
>
> Sub Main(ByVal args() As String)
> Function Main(ByVal args() As String) As Integer
>
> The function Main lets you return a value to the OS.
>
> Or, you can use:
>
> Command
> My.Application.CommandLineArgs
> System.Environment.CommandLine
> System.Environment.GetCommandLineArgs()
>
> So you have lots of choices. The right one depends on your application
> really. If you are going to use the VB.NET application framework, then
> you will not want to use the Main method - but, use one of the other
> options.
>
> --
> Tom Shelton



Re: App design advise by Bill

Bill
Wed Apr 23 15:14:07 CDT 2008


"Tom Shelton" <tom_shelton@YOUKNOWTHEDRILLcomcast.net> wrote in message
news:ejxDQzXpIHA.3408@TK2MSFTNGP03.phx.gbl...
>
> If your asking how to get command line parameters, then in VB.NET you
> have several choices....
>
> Use a main method as your startup object:
>
> Sub Main(ByVal args() As String)
> Function Main(ByVal args() As String) As Integer
>
> The function Main lets you return a value to the OS.
>
> Or, you can use:
>
> Command
> My.Application.CommandLineArgs
> System.Environment.CommandLine
> System.Environment.GetCommandLineArgs()
>
> So you have lots of choices. The right one depends on your application
> really. If you are going to use the VB.NET application framework, then
> you will not want to use the Main method - but, use one of the other
> options.
>

And you can also use the My Application framework. Create a winforms app in
VB, then from the My Project pages, select the Application tab and click on
View Application Events. There you can handle the Me.Startup as well as the
Me.StartupNextInstance events, where the e.CommandLine returns a readonly
collection of the command line arguments.


Re: App design advise by Tom

Tom
Wed Apr 23 15:31:51 CDT 2008

On 2008-04-23, Bill McCarthy <Bill@N0SPAM.com> wrote:
>
> "Tom Shelton" <tom_shelton@YOUKNOWTHEDRILLcomcast.net> wrote in message
> news:ejxDQzXpIHA.3408@TK2MSFTNGP03.phx.gbl...
>>
>> If your asking how to get command line parameters, then in VB.NET you
>> have several choices....
>>
>> Use a main method as your startup object:
>>
>> Sub Main(ByVal args() As String)
>> Function Main(ByVal args() As String) As Integer
>>
>> The function Main lets you return a value to the OS.
>>
>> Or, you can use:
>>
>> Command
>> My.Application.CommandLineArgs
>> System.Environment.CommandLine
>> System.Environment.GetCommandLineArgs()
>>
>> So you have lots of choices. The right one depends on your application
>> really. If you are going to use the VB.NET application framework, then
>> you will not want to use the Main method - but, use one of the other
>> options.
>>
>
> And you can also use the My Application framework. Create a winforms app in
> VB, then from the My Project pages, select the Application tab and click on
> View Application Events. There you can handle the Me.Startup as well as the
> Me.StartupNextInstance events, where the e.CommandLine returns a readonly
> collection of the command line arguments.
>

Didn't know about that one :) Thanks.

--
Tom Shelton

Re: App design advise by Tom

Tom
Wed Apr 23 15:34:14 CDT 2008

On 2008-04-23, John <info@nospam.infovis.co.uk> wrote:
> Wouldn't a new instance of .net app be run on each incoming call resulting
> in multiple copies of app running?
>

That is true... Now if you only want one, then you make it a single
instance application, that before it exits locates the other instance
and then uses some form of interprocess communication (again, lots of
choices - but, for this I might just use the SendMessage api call with a
WM_COPYDATA message) to send the command line argument to the other
instance.

--
Tom Shelton