Passing a value to VB6

F

Freeserve

Hi,

I am trying to pass a value from an ASP script to a VB application running
on the server. The only way I have got this to work is by using a file,
which is too slow. I tried using DDE but if a VB app contains a form then I
can't get it to run under IIS. Anybody done something similar?
 
R

Ray at

How are you calling the VB app? Are you just executing it with a shell
command, or is it an activeX thing and you're creating it within your ASP
app?

Ray at work
 
F

Freeserve

Yes. It is a small VB app which sends a DDE string to another VB app which
is running all the time. It works from the command line, but as it uses a
form it hangs when called from an ASP script as I think it is trying to
interact with the desktop. (you can see the app in Task Manager). A
similar app which just writes to a file works OK.
 
R

Ray at

Person1: Is it A or B?
Person2: Yes

Nice. ;]

If it works from the command line, does it accept command$ arguments? If
so, execute it with the Wscript.Shell object. Here's a page about that.
http://www.aspfaq.com/2059

Ray at work
 
F

Freeserve

It's not ActiveX as you may have guessed. I am using Wscript.Shell, but
this doesn't work if the VB project has a form in it. If it has no form I
can take the command$ argument and write it to a file. To use DDE I need a
form with a TextBox. Even though the form doesn't display I think it causes
a problem when run from Wscript.Shell because you have to load the form even
if it doesn't display. (I am guessing here).

BTW I don't have to use DDE if you can suggest a better way. I just need to
pass some text from an ASP script to a running VB app on the server.

Thanks for your help.


Ray at said:
Person1: Is it A or B?
Person2: Yes

Nice. ;]

If it works from the command line, does it accept command$ arguments? If
so, execute it with the Wscript.Shell object. Here's a page about that.
http://www.aspfaq.com/2059

Ray at work


Freeserve said:
Yes. It is a small VB app which sends a DDE string to another VB app which
is running all the time. It works from the command line, but as it uses a
form it hangs when called from an ASP script as I think it is trying to
interact with the desktop. (you can see the app in Task Manager). A
similar app which just writes to a file works OK.



form
then
 
R

Ray at

Even if it's a GUI app, you may still be able to run it on the server. But
it's better to use applications that are created for running sans GUI.

I could have sworn I heard rumors about DDE being added to Microsoft's
"Deprecated Technologies" list. I'm not sure how true that is, as I believe
that netdde still exists in 2003, at least.

What are you trying to do here? Have a user submit a form, and then your
asp page will call one VB app which will then call another? If so, the
issue is with your VB app.

Ray at work
 
F

Freeserve

I have 1 app running on the server that communicates with the serial port
(sending data) and listens for DDE from either a local app, netDDE or from
the web server via the command line app. The communication between the web
server and the app doesn't have to be DDE, I used it because it if fairly
easy to implement in VB6. I have seen examples using a very similar method,
but the ran on PWS not IIS. PWS has an option to 'allow interaction with
the desktop' that IIS doesn't seem to have. I think you are correct about
DDE as it is not supported in VB.NOT, but using COM as an alternative is
difficult in VB6.

In summary the user submits a form that sends some text to the serial port.
The VB bit if for checking an to allow another GUI to also use the same
port.


I had hoped to get the communication with the serial port to be 2 way, but
one way will do for now!

Any suggestions?
 
P

Phillip Windell

If it is done with VB than it is not "commandline"!

VB doesn't do "commandline" (aka "console" applications)

--

Phillip Windell [CCNA, MVP, MCP]
(e-mail address removed)
WAND-TV (ABC Affiliate)
www.wandtv.com
 
P

Phillip Windell

If it is done with VB than it is not "commandline"!

VB doesn't do "commandline" (aka "console" applications)

--

Phillip Windell [CCNA, MVP, MCP]
(e-mail address removed)
WAND-TV (ABC Affiliate)
www.wandtv.com
 
F

Freeserve

well its a VB app which I run from the command line like:

aspsend some_text

and some_text is sent to the other app. The problem is this doesn't work
when called from an ASP script if the VB has a form in it but does work if
it doesn't as in the case of writing to a file. I want to use DDE which
requires a form.


Phillip Windell said:
If it is done with VB than it is not "commandline"!

VB doesn't do "commandline" (aka "console" applications)

--

Phillip Windell [CCNA, MVP, MCP]
(e-mail address removed)
WAND-TV (ABC Affiliate)
www.wandtv.com

Freeserve said:
I have 1 app running on the server that communicates with the serial port
(sending data) and listens for DDE from either a local app, netDDE or from
the web server via the command line app. The communication between the web
server and the app doesn't have to be DDE, I used it because it if fairly
easy to implement in VB6. I have seen examples using a very similar method,
but the ran on PWS not IIS. PWS has an option to 'allow interaction with
the desktop' that IIS doesn't seem to have. I think you are correct about
DDE as it is not supported in VB.NOT, but using COM as an alternative is
difficult in VB6.

In summary the user submits a form that sends some text to the serial port.
The VB bit if for checking an to allow another GUI to also use the same
port.


I had hoped to get the communication with the serial port to be 2 way, but
one way will do for now!

Any suggestions?


"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message server. I no form
I DDE I
need just
 
B

Bob Barrows

Phillip said:
If it is done with VB than it is not "commandline"!

VB doesn't do "commandline" (aka "console" applications)
Actually, it does. But this is a topic for another newgroup.

Bob
 
P

Phillip Windell

I have before, in fact I have one in use. But it is not a true
commendline app. It is really just a normal VB App with a form that
has the form property set to invisible and the code executed from the
form's OnLoad event and then "self exits" at the bottom of the Sub.


--

Phillip Windell [CCNA, MVP, MCP]
(e-mail address removed)
WAND-TV (ABC Affiliate)
www.wandtv.com

Ray at said:
You can create command line apps in VB. It's just clumsy to do so.

Ray at work
 
P

Phillip Windell

VB is designed to take "parameters" from the user interacting with the
App's form. I think it was a rather convoluted process to get a VB
App to accept commandline parameters. I read some about it once, never
tried it, thought it wasn't worth the trouble, and now I don't even
remember what the process was to do it.

You need to ask in a VB group.


--

Phillip Windell [CCNA, MVP, MCP]
(e-mail address removed)
WAND-TV (ABC Affiliate)
www.wandtv.com

Freeserve said:
well its a VB app which I run from the command line like:

aspsend some_text

and some_text is sent to the other app. The problem is this doesn't work
when called from an ASP script if the VB has a form in it but does work if
it doesn't as in the case of writing to a file. I want to use DDE which
requires a form.


Phillip Windell said:
If it is done with VB than it is not "commandline"!

VB doesn't do "commandline" (aka "console" applications)

--

Phillip Windell [CCNA, MVP, MCP]
(e-mail address removed)
WAND-TV (ABC Affiliate)
www.wandtv.com

Freeserve said:
I have 1 app running on the server that communicates with the
serial
port
(sending data) and listens for DDE from either a local app,
netDDE
or from
the web server via the command line app. The communication
between
the web
server and the app doesn't have to be DDE, I used it because it
if
fairly
easy to implement in VB6. I have seen examples using a very
similar
method,
but the ran on PWS not IIS. PWS has an option to 'allow
interaction
with
the desktop' that IIS doesn't seem to have. I think you are
correct
about
DDE as it is not supported in VB.NOT, but using COM as an alternative is
difficult in VB6.

In summary the user submits a form that sends some text to the serial port.
The VB bit if for checking an to allow another GUI to also use
the
same
port.


I had hoped to get the communication with the serial port to be
2
way, but
one way will do for now!

Any suggestions?


"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
Even if it's a GUI app, you may still be able to run it on the server.
But
it's better to use applications that are created for running
sans
GUI.
I could have sworn I heard rumors about DDE being added to Microsoft's
"Deprecated Technologies" list. I'm not sure how true that
is, as
I
believe
that netdde still exists in 2003, at least.

What are you trying to do here? Have a user submit a form,
and
then your
asp page will call one VB app which will then call another?
If
so, the
issue is with your VB app.

Ray at work


It's not ActiveX as you may have guessed. I am using Wscript.Shell, but
this doesn't work if the VB project has a form in it. If it
has
no form
I
can take the command$ argument and write it to a file. To
use
DDE I
need
a
form with a TextBox. Even though the form doesn't display I think it
causes
a problem when run from Wscript.Shell because you have to
load
the form
even
if it doesn't display. (I am guessing here).

BTW I don't have to use DDE if you can suggest a better way.
I
just
need
to
pass some text from an ASP script to a running VB app on the server.
 
R

Ray at

I agree. VB is definitely not a good language for command line apps. I
also have one that I made that runs every night while I sleep. It works,
but if I had my choice, I'd redo it in C. First I'd have to learn C though.
;]

You don't have to have a form.

Ray at home

Phillip Windell said:
I have before, in fact I have one in use. But it is not a true
commendline app. It is really just a normal VB App with a form that
has the form property set to invisible and the code executed from the
form's OnLoad event and then "self exits" at the bottom of the Sub.


--

Phillip Windell [CCNA, MVP, MCP]
(e-mail address removed)
WAND-TV (ABC Affiliate)
www.wandtv.com
 
P

Phillip Windell

Ray at said:
also have one that I made that runs every night while I sleep. It works,
but if I had my choice, I'd redo it in C. First I'd have to learn C
though.

Same here. I took one smemester of C++ but dropped it because the
teacher did so poorly it was a waste of time. I may do it again later
with a different teacher.
You don't have to have a form.

Use the Code Module? Well, doesn't matter, it's too "OT" anyway and
I don't want to keep dragging the thread out.

--

Phillip Windell [CCNA, MVP, MCP]
(e-mail address removed)
WAND-TV (ABC Affiliate)
www.wandtv.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top