App design advise

  • Thread starter Thread starter John
  • Start date Start date
J

John

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
 
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.
 
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 said:
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.
 
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.
 
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.
 
Back
Top