For every question, there's an answer -- and you'll find it here!


Printer-friendly copy
Top The PC Q&A Forum The Computer Forum topic #1167
View in linear mode

Subject: "question for anyone who knows ms visual basic" Previous topic | Next topic
flegmatoSat Dec-15-01 06:53 AM
Charter member
55 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
"question for anyone who knows ms visual basic"


          

i'm writing a little app with vb. i'm trying to make it so that when you click a button, it runs another program with data from fields in my program in the command line. does this make sense? i would appreciate help if you know how to do this. thanx in advance.

  

Alert Printer-friendly copy | | Top

Replies to this topic
Subject Author Message Date ID
RE: question for anyone who knows ms visual basic
Dec 15th 2001
1
RE: question for anyone who knows ms visual basic
Dec 15th 2001
2
RE: question for anyone who knows ms visual basic
Dec 15th 2001
3
      RE: question for anyone who knows ms visual basic
Dec 15th 2001
4
      RE: question for anyone who knows ms visual basic
May 22nd 2003
9
           RE: question for anyone who knows ms visual basic
Dec 15th 2001
5
                RE: question for anyone who knows ms visual basic
Dec 15th 2001
6
                     RE: question for anyone who knows ms visual basic
Dec 15th 2001
7
                          RE: question for anyone who knows ms visual basic
Dec 15th 2001
8

SteveYandlSat Dec-15-01 07:24 AM
Charter member
6481 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#1. "RE: question for anyone who knows ms visual basic"
In response to flegmato (Reply # 0)


          

The approach you take will depend on the program that you are trying to remotely control. If that program exposes a scriptable object, there are probably methods or properties that can be fed a value from within your vb program. If not, you can use the run method of the WScript shell object and feed it arguments.

What program are you working with?

  

Alert Printer-friendly copy | | Top

flegmatoSat Dec-15-01 08:56 AM
Charter member
55 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#2. "RE: question for anyone who knows ms visual basic"
In response to flegmato (Reply # 0)


          

the program that i am trying to run is a dos based program that converts *.tga image files to *.vbm files (an image format used in certain games). it doesnt use any outside files (other than the tga file). makevbm.exe is the program that converts it. normally you run it from the command line by typing the program name then data about the image you want to convert. you would type this on the command line for example:

makevbm 4444 12 cowsrule.tga

(4444 has to do w/ the bits) (12 is the frames per second) (cowsrule.tga is the name of the file)

people seem to be having a lot of trouble with it (mainly because they arent used to dos). what i am trying to do is simplify it by making a little interface that lets you select the bits, the fps, and the image file name w/o having to use dos. i made the interface so these options can be selected/typed in. now i just wanna make it so my program will run makevbm with these options.

thanks.

  

Alert Printer-friendly copy | | Top

    
SteveYandlSat Dec-15-01 09:31 AM
Charter member
6481 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#3. "RE: question for anyone who knows ms visual basic"
In response to flegmato (Reply # 2)


          

I can take a better look at this tomorrow but what you want to do is something like:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("%comspec% makevbm 4444 12 " var1 )


where var1 is the variable that you've already created and set equal to the file name that you want makevbm to work with. The hard part is getting the quotes and spaces correct, a little trial and error is usually required. The %comspec% variable insures the the correct command interpreter is used regardless of OS (command.com or cmd.exe)

  

Alert Printer-friendly copy | | Top

        
flegmatoSat Dec-15-01 10:01 AM
Charter member
55 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#4. "RE: question for anyone who knows ms visual basic"
In response to SteveYandl (Reply # 3)
Sat Dec-15-01 10:01 AM

          

this helps a lot, thanx. but what i am trying to do is so that the user enters the value/string into a text box or selects it from a combo box and my program puts this into one of the parts. in other words if we are looking at my example, the user needs to be able to say 4444 and 12 and cowsrule.tga because they wont always have these values, those were just examples. thanks.

  

Alert Printer-friendly copy | | Top

        
flegmatoThu May-22-03 01:27 AM
Charter member
55 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#9. "RE: question for anyone who knows ms visual basic"
In response to SteveYandl (Reply # 3)


          

here this picture of the interface i made may help to clear things up a little about what i have done and am trying to do

Attachment #1, (gif file)

  

Alert Printer-friendly copy | | Top

            
SteveYandlSat Dec-15-01 10:22 AM
Charter member
6481 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#5. "RE: question for anyone who knows ms visual basic"
In response to flegmato (Reply # 9)


          

You're going to dim some variables as strings and the onClick event for the button will set those variables equal to what is selected in the boxes. You may have to write some code to edit or reject entries that will not work with the dos program or use combo boxes instead of text entry boxes. Where I've shown actual numbers, you would enter the variables.

  

Alert Printer-friendly copy | | Top

                
flegmatoSat Dec-15-01 10:29 AM
Charter member
55 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#6. "RE: question for anyone who knows ms visual basic"
In response to SteveYandl (Reply # 5)
Sat Dec-15-01 10:39 AM

          

ok.. thanx alot

EDIT: btw i cant use combo boxes for the fps and filename because they can vary greatly

  

Alert Printer-friendly copy | | Top

                    
SteveYandlSat Dec-15-01 07:58 PM
Charter member
6481 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#7. "RE: question for anyone who knows ms visual basic"
In response to flegmato (Reply # 6)


          

If you can't use combo boxes, take the time to write code that will pause your program and request a new user entry if they enter something totally crazy. You don't want to be troubleshooting later and try to figure out if the error is in your visual basic or if the dos program is stumbling with a bad argument. Also, you may have to do some conversions of data types from strings to integers etc.

  

Alert Printer-friendly copy | | Top

                        
flegmatoSat Dec-15-01 09:35 PM
Charter member
55 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#8. "RE: question for anyone who knows ms visual basic"
In response to SteveYandl (Reply # 7)


          

ok thanx...

  

Alert Printer-friendly copy | | Top

Top The PC Q&A Forum The Computer Forum topic #1167 Previous topic | Next topic
Powered by DCForum+ Version 1.27
Copyright 1997-2003 DCScripts.com
Home
Links
About PCQandA
Link To Us
Support PCQandA
Privacy Policy
In Memoriam
Acceptable Use Policy

Have a question or problem regarding this forum? Check here for the answer.