Click to See Complete Forum and Search --> : Making an exe to write an exe... FUN!
RoundCow
Nov 3rd, 1999, 08:32 AM
How can i make an exe write another exe?...
i tried putting the exe code in a text and then just writing it into a file... but that did not work... so what will work?
-RoundCow
Compwiz
Nov 3rd, 1999, 08:38 AM
If all the compiling has been done, then you have open and write it in BINARY form because text sometimes takes out null characters and etc. And why can't you just use FileCopy?
------------------
Tom Young, 14 Year Old
tom@e-bizinternet.com
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer
RoundCow
Nov 3rd, 1999, 11:58 AM
well... i can't use file copy because i want it to create the exe... so then everything would be in one file... how do i copy it as a binary?
Mark Sreeves
Nov 3rd, 1999, 08:10 PM
if it is quite a simple exe you want (no graphics etc)
Write the code for the final program.
ie form, project file, bas file
open these files in notepad.
within your "master" program write code to write this text out to files. (this is a bit awkward because of printing out " marks
you can then do this
(ProjectName is the path to your secondry project file)
Dim strCommand As String
strCommand = "C:\Program Files\DevStudio\VB\vb5.exe " & Quote & ProjectName & Quote & " /make"
Shell strCommand
this will write the exe file by running vb invisably
you can then delete all the secondary source code files
If the exact path to vb.exe is not known this can be found....
Let em know if you need to know how to do this
------------------
Mark Sreeves
Analyst Programmer
Mark.Sreeves@Softlab.co.uk
A BMW Group Company
Mark Sreeves
Nov 3rd, 1999, 08:17 PM
Sorry in that code I forgot to include
CONST Quote = """"
you can replace " when writing to a file with & quote &
a bid clener than using chr$(34)
------------------
Mark Sreeves
Analyst Programmer
Mark.Sreeves@Softlab.co.uk
A BMW Group Company
jimdalby
Nov 4th, 1999, 02:22 AM
Just outa interest , r u trying 2 make a program that sort of evolves? If u r, I would very much like 2 c it!
Mark Sreeves
Nov 7th, 1999, 03:45 PM
RoundCow,
Did you solve this one in the end?
------------------
Mark Sreeves
Analyst Programmer
Mark.Sreeves@Softlab.co.uk
A BMW Group Company
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.