Solved

Shell syntex & Dial-up monitoring

Posted on 1998-06-16
6
251 Views
Last Modified: 2013-11-13
Two Questions: 1) Is it possible with the Shell command to allow command line
arguments to be taken from a Textbox? Example: Shell("App.exe "Text1", 1)
Text1 being user input data to be added to the Shell command line. I noticed
that Shell command won't read it?

2) I like a reliable method for dialing & monitoring the winsock connection 98/NT
and if lost, redial any number of times till the connection is re-established. While
the connection is active, ping every 5 mins incase of inactivity to prevent premature disconnection.

Looking forward to a wonderful reply from one of you VB guru's.
0
Comment
Question by:Capital1
  • 3
  • 2
6 Comments
 

Author Comment

by:Capital1
Comment Utility
Edited text of question
0
 

Author Comment

by:Capital1
Comment Utility
Edited text of question
0
 
LVL 18

Expert Comment

by:deighton
Comment Utility
Shell("App.exe " +  Text1, 1)
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Expert Comment

by:Biffo
Comment Utility
Proper syntax for what you want is to predfine the commands outside of the shell command line or VB will trip out and puke:

'Besure to add a extra space with last  " to space the Text1 input out
EX = "App.exe " & Text1
'Then go ahead and Shell as:

Shell(EX, 1)

0
 
LVL 2

Accepted Solution

by:
Biffo earned 100 total points
Comment Utility
I'm sorry, I should had answered your questioned when I commented earlier on your Shell question.  I'll cover your question #2 since internet programming is one of specialities.

There is a number of ways of accomplishing what you want, some more involved than others. I'll direct you to perhaps the most straight forward way and by far the most easiest and best documented. Go to Catalyst Developement home web site at: www.catalyst.com and download
their SocketWrench kit. Note: SocketWrench, not their SocketTool kit since that cost $$ to use whereas SocketWrench is FREE and you can do whatever you want with it.

Install. It comes with CSRAS32.OCX and CSPING32.OCX. Load the sample VB5 Stdialer form, you can work off that as your project. Essentially you can follow your nose with developing it with the help topics that come with it to your needs. Example to have it reconnect automatically when disconneted you could add this to the form:


Private Sub Dialer1_Disconnect()
   
    If Dialer1.Connected = False Then
    Call ActionButton_Click
    End if

If you have AutoUpdate in properties set to True, then as soon as it loses connection it will immediately redial. AutoUpdate monitors the connection every second I beleive with the default interval setting.  You can then drop in the CSPING32.OCX  and set the interval to whater you like, say ping every 2 or 5 minutes with some code like:

Private Sub PingHostAddress()
    'Start up the Ping control on a host

    Ping1.hostaddress = hostaddress
    Ping1.Blocking = True
    Ping1.Interval = 1000
    Ping1.Enabled = True

End Sub

See the Netcheck sample project for ping info and usage.  This will do it, you will be able to build a dialer and have it do whatever you want using SocketWrench.

 -Jim

0
 

Author Comment

by:Capital1
Comment Utility
Great !!!!!!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now