471,317 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

Interesting Q

Hi All, I have a VBScript that does a bunch of stuff except for 1, for that
I had to write a CS Application. I want to call that CS Application in the
VBScript and depending on the return code of the CSApp I need to execute a
step.
how can I get return codes out of CSApp in VBScript?

TIA
Nov 29 '05 #1
6 1240

"Vai2000" <no****@microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Hi All, I have a VBScript that does a bunch of stuff except for 1, for
that
I had to write a CS Application. I want to call that CS Application in the
VBScript and depending on the return code of the CSApp I need to execute a
step.
how can I get return codes out of CSApp in VBScript?

TIA


Hrm, without testing, I dunno how to get the return code for a CSApp...but
is there a reason why you didn't make this a C# Class Library and just call
a function that returns the value(s) you want?

Mythran

Nov 29 '05 #2
Like I said have an existing VBScript which is in Production, its failing to
do that 1 thing for which CS is awesome...(DataTables) so I coded that
routine in CS Console App now the trick is to incorporate into the existing
VBS..I am open to writing the CSApp in VB.NET will that buy me anything?

TIA
"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:e1****************@TK2MSFTNGP09.phx.gbl...

"Vai2000" <no****@microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Hi All, I have a VBScript that does a bunch of stuff except for 1, for
that
I had to write a CS Application. I want to call that CS Application in the VBScript and depending on the return code of the CSApp I need to execute a step.
how can I get return codes out of CSApp in VBScript?

TIA
Hrm, without testing, I dunno how to get the return code for a CSApp...but
is there a reason why you didn't make this a C# Class Library and just

call a function that returns the value(s) you want?

Mythran

Nov 29 '05 #3
> "Vai2000" <no****@microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Hi All, I have a VBScript that does a bunch of stuff except for 1,
for
that
I had to write a CS Application. I want to call that CS Application
in the
VBScript and depending on the return code of the CSApp I need to
execute a
step.
how can I get return codes out of CSApp in VBScript?
TIA

Hrm, without testing, I dunno how to get the return code for a
CSApp...but is there a reason why you didn't make this a C# Class
Library and just call a function that returns the value(s) you want?

Mythran


You'll have to expose your CSApp to COM to be able to use it in VBScript.
Nov 29 '05 #4
Vai2000,

You will be limited to returning a numeric return code, and you will
return that from your Main method.

Then, you just call your program like you would call any other program
from VB script.

However, the other suggestions for exposing a COM component from .NET
are better alternatives.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Vai2000" <no****@microsoft.com> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
Like I said have an existing VBScript which is in Production, its failing
to
do that 1 thing for which CS is awesome...(DataTables) so I coded that
routine in CS Console App now the trick is to incorporate into the
existing
VBS..I am open to writing the CSApp in VB.NET will that buy me anything?

TIA
"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:e1****************@TK2MSFTNGP09.phx.gbl...

"Vai2000" <no****@microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
> Hi All, I have a VBScript that does a bunch of stuff except for 1, for
> that
> I had to write a CS Application. I want to call that CS Application in the > VBScript and depending on the return code of the CSApp I need to
> execute a > step.
> how can I get return codes out of CSApp in VBScript?
>
> TIA
>
>


Hrm, without testing, I dunno how to get the return code for a
CSApp...but
is there a reason why you didn't make this a C# Class Library and just

call
a function that returns the value(s) you want?

Mythran


Nov 29 '05 #5
> I am open to writing the CSApp in VB.NET will that buy me anything?

VB.Net and C# are basically the same thing, so I think you have a plan
there. Mixing VBScript and .Net programming is going to be difficult at
best.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition

"Vai2000" <no****@microsoft.com> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
Like I said have an existing VBScript which is in Production, its failing
to
do that 1 thing for which CS is awesome...(DataTables) so I coded that
routine in CS Console App now the trick is to incorporate into the
existing
VBS..I am open to writing the CSApp in VB.NET will that buy me anything?

TIA

Nov 29 '05 #6

"chris martin" <chris_m|NOSPAM|@caliber|SPAM|web.com> wrote in message
news:44*************************@news.easynews.com ...
"Vai2000" <no****@microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Hi All, I have a VBScript that does a bunch of stuff except for 1,
for
that
I had to write a CS Application. I want to call that CS Application
in the
VBScript and depending on the return code of the CSApp I need to
execute a
step.
how can I get return codes out of CSApp in VBScript?
TIA

Hrm, without testing, I dunno how to get the return code for a
CSApp...but is there a reason why you didn't make this a C# Class
Library and just call a function that returns the value(s) you want?

Mythran


You'll have to expose your CSApp to COM to be able to use it in VBScript.


Yes, I was suggesting that this be done, as a class library. He can create
the class library assembly in VB.Net or C# or any other .Net language, make
it COM library, then he can call the method using VBScript using the
CreateObject function. From there, he can get a return value in any COM
form available, rather than just a return code (numeric).

He can also pass non-string values to the COM component. A console
application can only be passed string-based arguments (can be converted to
numeric value afterwards, or parsed and converted via serialization, but why
do this?).

Anywho, that's my suggestion for the OP :)

Mythran

Nov 29 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Bruno R. Dias | last post: by
12 posts views Thread by rawrite | last post: by
3 posts views Thread by Johnny Lee | last post: by
8 posts views Thread by Mythran | last post: by
28 posts views Thread by v4vijayakumar | last post: by
126 posts views Thread by jacob navia | last post: by
4 posts views Thread by timer | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.