DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 1 of 2 12 LastLast
Results 1 to 15 of 26

Thread: Create Project that make .exe

  1. #1
    Join Date
    Nov 2004
    Posts
    18

    Create Project that make .exe

    I want to create a program that can make it's own exe files, like VB6, Game Maker and others. How would I do this?

  2. #2
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    How long have you been programming?

    I ask because this is not a light undertaking...companies spend years writing programs to do this. They're called Compilers, and they're generally written in C or C++, with some Assembly Language thrown in.

    Unless you're very experienced in the above languages, I wouldn't tackle this one on your own. If you are, there are plenty of books out there on writing compilers- have a look at http://www.fatbrain.com or http://www.amazon.com.


    Out of curiosity- why do you want to do this, anyway?


    -Andrew
    Last edited by Andrew Cushen; 11-15-2004 at 12:19 PM.

  3. #3
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    35
    I'm guessing, and correct me if I'm wrong, that you have a studio that allows you to write code but not compile. This is usually so with Microsoft Visual Basic 6.0 Working Model/Learning or Control Creation Edition. To create an executable in so platform you will need to buy the Professional or Enterprise edition

    Disregard if this has nothing to do with your situation.
    "Those who would sacrifice liberty for security, deserve neither liberty nor security." -- Benjamin Franklin

  4. #4
    Join Date
    Nov 2004
    Posts
    9
    I got Enterprise and Pro but I still haven't found out how

  5. #5
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    Hmm...

    I may have misunderstood your question. I thought you wanted to create a program that itself could create another program. If so, my original advice applies.

    If not, and all you want is to make your VB6 program into a .EXE file, then:

    once you have a working program, all you need to do is open the project, then go to the FILE menu and choose "Make Project1.EXE...", where Project1 is the name of your project.

    Next, you will see a dialog that allows you to choose where the .EXE file will be made, and to rename the .EXE file if you want. There is a button labeled "Options..." that lets you set some further options; you'll probably want to leave these alone for the time being, until you've made a few .EXE files and understand the process better.

    And that's all there is to it!


    -Andrew

  6. #6
    Join Date
    Nov 2004
    Posts
    16

    Re: Create Project that make .exe

    Originally posted by mikesena
    like VB6, Game Maker and others
    he defiently means an EXE which can make EXEs.

  7. #7
    Join Date
    Nov 2004
    Posts
    18
    That's right!!! Lol

  8. #8
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    I don't know why you're "LOL", but then my original post stands: you're not going to be able to do this in VB. You'll need to learn C and possibly Assembly Language.

    Good Luck,

    -Andrew
    Last edited by Andrew Cushen; 02-10-2007 at 11:36 AM.

  9. #9
    Join Date
    Nov 2004
    Posts
    16
    well. i once had an idea of how to do it in VB.

    just make a form with all the objects needed

    make another project (the editor or whatever) which sets whether certain objects are shown or not in an INI file or something

    and the 1st form could use the INI and load all it's info..

    this would be highly restricted but could work.

  10. #10
    Join Date
    Nov 2004
    Posts
    18
    Do you know how to change or add resource files (not in VB6, while the program is running or has been compiled)

  11. #11
    Join Date
    Feb 2004
    Location
    Colton, CA
    Posts
    550
    Originally posted by Andrew Cushen
    I don't know why you're "LOL", but then my original post stands: you're not going to be able to do this in VB. Youy'll need to learn C and possibly Assembly Language.

    Good Luck,

    -Andrew
    He's laughing out loud because someone changed the tack of the thread and threw you off the scent. Small amount of confusion is sometimes amusing, i'm sure you'll agree

  12. #12
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    well. i once had an idea of how to do it in VB.

    just make a form with all the objects needed

    make another project (the editor or whatever) which sets whether certain objects are shown or not in an INI file or something...
    Hmm...I still don't think that approach is going to allow you to create an executable file. Certainly you could create a file that changes how YOUR executable runs, and what it does, through methods similar to what you mentioned, and you could even change your .EXE's behavior with command-line switches (VB's Command object), but that's not the same as creating an executable file (.EXE).

    I notice no one here has jumped in with their 2 cents...which leads me to believe I'm right.

    VB is a powerful tool, and you can extend that power quite a bit by calling API functions and subclassing, but VB was never meant to be a compiler-creation language. First of all, it's simply not fast enough- even C by itself is not always fast enough, that's why compiler programmers use Assembly Language too- and it can't (AFAIK) make the low-level OS calls necessary, like C/C++ and Assembly can.

    Believe me, I'd like to tell you it can be done in VB, but I'm afraid it can't.


    -Andrew
    Last edited by Andrew Cushen; 02-10-2007 at 11:37 AM.

  13. #13
    Join Date
    Nov 2004
    Posts
    16
    Originally posted by RHelliwell
    Hmm...I still don't think that approach is going to allow you to create an executable file. Certainly you could create a file that changes how YOUR executable runs, and what it does, through methods similar to what you mentioned, and you could even change your .EXE's behavior with command-line switches (VB's Command object), but that's not the same as creating an executable file (.EXE).
    that's exactly what i meant, and why i said it would be highly restricted.


    Do you know how to change or add resource files
    Nope. I have no idea. i'm still kinda a n00b at VB

  14. #14
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    Originally posted by mikesena
    Do you know how to change or add resource files (not in VB6, while the program is running or has been compiled)
    Yes, this is a concept sometimes referred to as "satellite .DLLs". It's often used to make a program load different strings (text) for dialog boxes etc. depending on which country the user has their PC set to.

    The basic idea is that for each Resource file, you create an ActiveX .DLL, and add the resource file to it. Then, at runtime, your code can call a different .DLL depending on your code; for instance, your code can use the GetUserDefaultLangID() API function to find out what country the PC is set to, and then call the .DLL that contains the language strings for that country. You could even ship an updated .DLL months after the original app, and have the user or some code call it. The trick is to use the primary .DLL as the interface that the .DLLs for the other countries must implement.


    The full concept, and the code required to execute it, is a bit too long to go into here; I recommend you pick up the book Programming Microsoft Visual Basic 6.0 by Francesco Balena, ISBN 0-7356-0558-0, Microsoft Press. He gives an example, and example code, on pp. 869-875; not to mention that the rest of the book is excellent as well, and recommended if you're at the beginner- to intermediate- stage of learning VB6. The book also includes a CD-ROM with all the souce code for the book, including the full Satellite .DLL example.



    HTH,


    -Andrew

  15. #15
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    Originally posted by Dan2552
    that's exactly what i meant, and why i said it would be highly restricted.
    Again, that's not creating an .EXE file. If he's willing to settle for something like that, that's fine; but it's not gonna create a Portable-Executable-Format .EXE file.

    What you're suggesting would require you to give 2 programs to your "users"; one to create the "data" files that tell the .EXE file what to do, and the other, an .EXE file that was created, by you, ahead of time, in VB or C/C++/Assembly. There's just no way around the need for the .EXE file, which must be created in a compiler. And if you went this approach, you would have to choose between:

    1) Writing a BLOODY TON of "If...Then...Else" code, which would take months and months

    or

    2) Having a program which produced other "programs" that were not very different from each other.


    I think perhaps what you're suggesting is along the lines of a Game Engine. AFAIK, the good ones still require additional code written in C/C++/Assembly, and compiled using a compiler. The ones that you can use without writing any code are generally not all that great, or require a ton of work to create something that doesn't look like it came out of a cookie cutter.


    The only other thing I can think of is that it's possible that someone has written, in C/C++/Assembly, a library or VB add-in that can do what you want. If so, I haven't heard of it; but there is a chance that something like that is out there. You might want to spend some time with Google and Yahoo and see what you can find.


    VB6, by itself, is just not the right tool for the job.


    -Andrew

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center