|
I have created a .class file by using java. I can execute it in the command prompt.
like this
E:\Pro Languages\Java\Test1>set path = D:\Program Files\Java\jdk1.5.0_06
E:\Pro Languages\Java\Test1>java MyApp
I expect to create a small & simple EXE file, to implement above commands. I do not like to use VB.Net because I have to install .Net framework to computers which have java only. Therefore, I decided to use VB6.
I have three questions.
1. How to implement above commands by using VB6
2. Do I need to install VB6 to computers (which do not have VB6), before executing that simple EXE file
3. Are there any other ways to do it
Never mind, if you can answer atleast one question
Thank You,
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
Does VB6 offer ShellExecute ? Why don't you use C++ ? Then you can just call ShellExecute and be done with it.
If all you want to do is run the app, a batch file is another solution.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes,VB6 offers ShellExecute. I have no idea about ShellExecute. Here is an example which I found in MSDN.
Clicking the command1, but I can go to URL with the default web browser. I need your support to change it according to my question.
Private Declare Function ShellExecute _<br />
Lib "shell32.dll" _<br />
Alias "ShellExecuteA" ( _<br />
ByVal hwnd As Long, _<br />
ByVal lpOperation As String, _<br />
ByVal lpFile As String, _<br />
ByVal lpParameters As String, _<br />
ByVal lpDirectory As String, _<br />
ByVal nShowCmd As Long) _<br />
As Long<br />
<br />
Private Sub Command1_Click()<br />
Dim r As Long<br />
r = ShellExecute(0, "open", "http://www.microsoft.com", 0, 0, 1)<br />
End Sub
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
Batch file works well,
but I cannot assign an icon to the batch file.
Therefore I run the batch file by creating an EXE file, like this
Private Declare Function ShellExecute _<br />
Lib "shell32.dll" _<br />
Alias "ShellExecuteA" ( _<br />
ByVal hwnd As Long, _<br />
ByVal lpOperation As String, _<br />
ByVal lpFile As String, _<br />
ByVal lpParameters As String, _<br />
ByVal lpDirectory As String, _<br />
ByVal nShowCmd As Long) _<br />
As Long<br />
<br />
Private Sub Form_Load()<br />
Dim r As Long<br />
r = ShellExecute(0, "open", "E:\Pro Languages\Java\Test1\MyApp.bat", 0, 0, 1)<br />
End<br />
End Sub
Is there a way to execute the command by using EXE file only (without the batch file)?
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
Take the commands out of the batch file and put them in your VB calls to shellexecute.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I tried this,
Private Declare Function ShellExecute _<br />
Lib "shell32.dll" _<br />
Alias "ShellExecuteA" ( _<br />
ByVal hwnd As Long, _<br />
ByVal lpOperation As String, _<br />
ByVal lpFile As String, _<br />
ByVal lpParameters As String, _<br />
ByVal lpDirectory As String, _<br />
ByVal nShowCmd As Long) _<br />
As Long<br />
<br />
<br />
Private Sub Form_Load()<br />
Dim r As Long<br />
r = ShellExecute(0, "open", "set path = D:\program Files\Java\jdk1.5.0_06", 0, 0, 1)<br />
r = ShellExecute(0, "open", "java MyApp", 0, 0, 1)<br />
End<br />
End Sub
But it doesn’t work. Can you change it?
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
You don't need all that junk. VB6 has it's own built-in Shell function. Also, if you're only running this on NT kernel machines, you can also put all your command-line statements together and run them all at once like this:
C:\>SET PATH=D:\Program Files\Java\jdk1.5.0_06 & Java MyApp
Soooo, you can do this in one or two lines:
Dim commandLine As String
commandLine = "CMD /K ""SET PATH=D:\Program Files\Java\jdk1.5.0_06 & JAVA MyApp"""
' The vbHide option (0) should hide the command window and show only your Java app
Shell(commandLine, vbHide)
I can't test this code because I haven't had VB6 installed anywhere for the last, oh, 4 years at least. But, I can tell you that any machine you put this on will require the VB6 Runtime[^] in order to run.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you Dave It works when I use this
Dim commandLine As String<br />
commandLine = "CMD /K ""set path = D:\program Files\Java\jdk1.5.0_06 & java MyApp"""<br />
Dim runMyApp As Double<br />
runMyApp = Shell(commandLine, vbNormalFocus)
Thank you Cristian
Thank you Dave
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
My problem is:
I have to rotate a picture for 180 degrees in VB 6.0 and show it in PictureBox/ImageBox. Does anyone knows how to do that?
Thank you
|
|
|
|
|
|
Hi all. This may be a silly question, but does anyone know definitively what the keyword "Sub" in Visual Basic is short for (or, perhaps "derived from" is a better expression)? Does it come from "subroutine", "subprogram", something else? Or did the VB creators just call it "Sub" with no intent to reference earlier forms of BASIC?
Or is "Sub" a bonafide keyword for BASIC (and not just Visual Basic)?
I'm not sure why I want to know... just curious, I guess.
|
|
|
|
|
I'm guessing it means subrouting. From earlier forms of basic "GO SUB"
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Hi Colin. That was always my guess too - but I wondered (call it a geek obsession) if there were a definitive history to it.
|
|
|
|
|
I've always though it was 'subroutine', and took it for granted...now I wonder...
hey...slang is the vernacular for the vernacular...wow
|
|
|
|
|
FrankyT wrote: hey...slang is the vernacular for the vernacular...wow
Ooooohhhh....
|
|
|
|
|
It is short for "subroutine" - has been as long as I've been involved with computers.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Page 422, chapter 9, of "Visual Basic 6 Complete", Table 9.5: Statements Supported in VBScript.
Sub - Declares a Subroutine
Looking at the example provided, a subroutine is a division or seperate event happening inside of an "event procedure" as described below.
Page 42, chapter 4, "Visual Basic 6 For Dummies"
In Visual Basic lingo, subprograms are event procedures (although some programmers may call them subroutines).
So my understanding would be that a "Sub" is actually an "Event Procedure" and a "Subroutine" is inside of an event procedure and seperated by a marker consisting of an apostrophe followed by a tilde ('~). The example is provided on page 441, chapter 9, of "Visual Basic 6 Complete".
Hope this helps, Garner
|
|
|
|
|
It's short for Subroutine.
It's an extension to the original BASIC language. In BASIC there are no subroutine structures, only the GOSUB command that jumps to a line number and returns using the RETURN command:
10 GOSUB 40<br />
20 END<br />
30 REM Here follows the subroutine:<br />
40 PRINT "Hello world!"<br />
50 RETURN
---
b { font-weight: normal; }
|
|
|
|
|
How can i make visualization like in winamp...
The sound frequency catcher...
You know what i mean... i hope so!!!
I need it for my project, actualy i want to know how to catch the sound frequency, dhe drawing is easy...
If u have ideas or know how to please answer me!!!
Thanks!!!
and
How to edit file Summary... Ummmmmmm when u right click on .mp3 file and properties you can edit summary is it possible in vb.net? To create a form where you can edit a summary for that file and save it? Please answer me...
Thanks again...
FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
|
I'm a long time programmer, but new to Visual Basic and Windows programming. I typically write code on unix machines and these are always text based applications. I have VS.NET 2003 and I've been playing with VB.NET as of late. What I'm wondering is what type of control would I use or how could I do an app similar to Microsoft Money or QuickBooks or Outlook. I'm strictly referring to the User interface here. The top and left of the main form always stay the same but the panel on the right seems to change or redisplay based on the item picked in the left panel. How is this done? Thanks for the help. Any links to articles or tutorials would be great.
Thanks.
|
|
|
|
|
Dear Friends,
Can some one tell me how can i read the Data written on an image. I have an image created by a eye testing machine. When I tried to read the readings on it by different kind of OCR and other image to word converter but its not reading the numbers. Please can some one tell how can i make my own image reader so that i can read the numbers and letters on it.
Your quick response will be highly appreciated.
Thanks
Patel Murtuza.
|
|
|
|
|
You could read my image processing articles as a starting point ( mainly the edge detection stuff) This is a non trival task, however, and my articles won't solve it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have a collection of objects (in this case, the objects are "Gauge Blocks"). Each Block in the Set (collection) has a length (i.e. 0.1009", 0.101"...). There are 81 Blocks in a Set. I need an algorithm that will determine what combination of Blocks are needed to build a stack for a given value of measurement, using the least amount of Blocks to build the stack. Also, I cannot use the same Block twice, because the Set only has one of each Block.
Example:
The inner width of the device being tested is 2.305". To manually build the stack from an 81 Block Set (or whatever size Set), I would normally start from the right most value of the tested dimension. In this case 5 is the right most value. I would locate a Block that has the same precision (2.305" has 3 digits of precision), so I would select a Block that has a 5 in the 3rd decimal place (i.e. 0.105" - The Blocks in each Set are NOT linear from 0.0001" to 4" in 0.0001" steps, which is why this is not as easy as I wish it was). Next I would find the next Block in the Set (2.305" - 0.105" = 2.200"), which is 0.2". That leaves me with 2", I use the 2" Block for a remainder of 0".
The typical Gauge Block Set includes the following values:
0.05,0.10,0.1001,0.1002,0.1003,0.1004,0.1005,0.1006,0.1007,0.1008,0.1009,0.101,0.102,
0.103,0.104,0.105,0.106,0.107,0.108,0.109,0.110,0.111,0.112,0.113,0.114,0.115,0.116,
0.117,0.118,0.119,0.120,0.121,0.122,0.123,0.124,0.125,0.126,0.127,0.128,0.129,0.130,
0.131,0.132,0.133,0.134,0.135,0.136,0.137,0.138,0.139,0.140,0.141,0.142,0.143,0.144,
0.145,0.146,0.147,0.148,0.149,0.15,0.20,0.25,0.30,0.35,0.40,0.45,0.50,0.55,0.60,0.65,
0.70,0.75,0.80,0.85,0.90,0.95,1,2,3,4
"Some people spend an entire lifetime wondering if they made a difference. The Marines don't have that problem."
( President Ronald Reagan)
|
|
|
|
|
You can use a recursive method to look for the valid combinations.
Make a method that takes a specific block and the space left in the device. Let it combine the block will all combination of smaller blocks. It does that by calling itself for each smaller block that still fits in the device, to find every combination using that block and any smaller block needed. Return the least number of blocks needed to fill the remaining gap.
---
b { font-weight: normal; }
|
|
|
|
|