open an exe file in a vb form.....
How to open an exe file in a vb form...
Means i made a calculator in vb and compiled it in exe file so know i wanna embed that exe file in another vb program i m making.. so that i press that button that exe file (Calculator) Pops up.... But it should b more like importing that exe file... cause when the exe file (calculator) is removed from that location it should not give error... i hope u understand my question....
And yes i m using VB 2005...
Thanx in advance too..
Re: open an exe file in a vb form.....
Quote:
Originally Posted by web315
How to open an exe file in a vb form...
Means i made a calculator in vb and compiled it in exe file so know i wanna embed that exe file in another vb program i m making.. so that i press that button that exe file (Calculator) Pops up.... But it should b more like importing that exe file... cause when the exe file (calculator) is removed from that location it should not give error... i hope u understand my question....
And yes i m using VB 2005...
Thanx in advance too..
Just a thought, but might it not be easier to just add the forms/code for the Calculator to your other VB app and just compile it all as one .exe?
Re: open an exe file in a vb form.....
Quote:
Originally Posted by yraen
Just a thought, but might it not be easier to just add the forms/code for the Calculator to your other VB app and just compile it all as one .exe?
No i cant do that... cause my coding clashes.... there should b any solution....
Re: open an exe file in a vb form.....
Quote:
Originally Posted by web315
No i cant do that... cause my coding clashes.... there should b any solution....
In that case, you could try the 'Shell' method, perhaps? Not sure it would give the 'importing' effect that you're looking for, but if you packaged the two applications together and kept them in the same directory it would probably work...
Code:
Private Sub cmdCalc_Click()
Shell("C:\mycalculator.exe", 1)
End Sub
EDIT: I'm a little rusty on true VB (been using VBS mostly), but there might be a simple option under the 'Project' menu item to add external files/exe's to your project. If I'm right, you could compile your calculator with your other application and be able to call it at will... maybe.
Re: open an exe file in a vb form.....
Re: open an exe file in a vb form.....
Yeah i agree with "chunks" use the Resource Editor, add your calcalator app as a custom resource, save it then use this code to extract it and execute it.
Code:
Public Sub LoadDataIntoFile(DataName As Integer, FileName As String)
Dim myArray() As Byte
Dim myFile As Long
If Dir(FileName) = "" Then
myArray = LoadResData(DataName, "CUSTOM")
myFile = FreeFile
Open FileName For Binary Access Write As #myFile
Put #myFile, , myArray
Close #myFile
End If
Shell FileName
End Sub
Re: open an exe file in a vb form.....
cdrcools, you are old member of codeguru, atleast you should use code tag when you post your code :(
Re: open an exe file in a vb form.....
Sorry, i don't know how you do that.
Re: open an exe file in a vb form.....
Quote:
Originally Posted by cdrcools
Sorry, i don't know how you do that.
pls see this, code tag makes your code readable to everyone very easier
http://www.codeguru.com/forum/misc.php?do=bbcode#code
Re: open an exe file in a vb form.....
Ok Thankyou
Code:
I was using the wrong Textbox Settings.
None of these other tools were available:(
Re: open an exe file in a vb form.....
now see your code above how nicely it can be read now :D
Re: open an exe file in a vb form.....
U can try out the shell command .
this works fine
eg:
shell "c:\test.exe"