Results 1 to 8 of 8
  1. #1
    5 Star Lounger Ruff_Hi's Avatar
    Join Date
    Feb 2001
    Location
    New York, New York, USA
    Posts
    768
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VB prog to compile VB (VB 6.0)

    Good Afternoon All,

    I've got a small programe that adds line numbers to VB projects. It also copies the modifed files to another directory and marks them read only.

    I want to be able to compile the resulting project to an exe file. I know that I need a command something like...

    <pre>vb6 /runexit /make myapp.vbp
    </pre>

    But how do I call that from within VB. I could use shell but that will be very obvious. Is there a better way?
    (Location Australia, then UK, but now USA. Heart, outlook, attitude, etc always Australian)
    Quote: "All Happiness is the release of internal pressure"

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VB prog to compile VB (VB 6.0)

    The selection to create an executable is on the File menu in VB. Is there some reason you don't want to do it that way? Or are you trying to create an executable on a different project from within VB?
    Charlotte

  3. #3
    New Lounger
    Join Date
    Sep 2001
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB prog to compile VB (VB 6.0)

    Using shell in the command line is the best way to compile your apps. Why not shell the command and dont show the window (if it is the dos window puts you off). Shell the command prompt hidden

    iReturn = Shell(sCommand, vbHide)

    then get a Handle to the process
    hProc = OpenProcess(PROCESS_ALL_ACCESS, false, iReturn)

    then in a loop
    check GetExitCodeProcess hProc, iExit
    and exit when iExit = &H103

    I can't remember the comment to compile - but it is in MSDN.

    Cheerz

    Al

  4. #4
    5 Star Lounger Ruff_Hi's Avatar
    Join Date
    Feb 2001
    Location
    New York, New York, USA
    Posts
    768
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB prog to compile VB (VB 6.0)

    Thanks Charlotte, I knew about the File, Make command.

    It seems that when I try to minimise the content of my 'post', the only thing that happens is that I get mis-understood ( <img src=/S/thinks.gif border=0 alt=thinks width=15 height=15> must be a life lesson in there somewhere) and have to provide greater details down the track.

    The full (?) situation is that I want to use line numbers in my error handling routines. There are programs available that add line numbers, move the source code to a read-only directory and compile the project all in one go. However, you have to pay for them.

    Now, me, not wanting to hand over money for something like this (I would prefer to go to the movies), decided to write my own program. When I run it, I select the VB project that I want line numbers added to and click on 'run'. This then adds line numbers to the selected project, copies the selected project to a sub directory, makes the files are read-only. Only one step missing, compiling the selected project.

    So, in short, I want a program that copies a project and compiles it but I'm not sure of the syntax for the vb6 call.

    I hope that that is clearer.

    Tim
    (Location Australia, then UK, but now USA. Heart, outlook, attitude, etc always Australian)
    Quote: "All Happiness is the release of internal pressure"

  5. #5
    New Lounger
    Join Date
    Sep 2001
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB prog to compile VB (VB 6.0)

    Tim,

    I just checked the command line options (vb6 /?) and what you want is

    vb6 /make projectname

    This tells VB to compile projectname and make an executable from it, using the existnig settings stored in the project file.

    HTH

    Al

  6. #6
    5 Star Lounger Ruff_Hi's Avatar
    Join Date
    Feb 2001
    Location
    New York, New York, USA
    Posts
    768
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB prog to compile VB (VB 6.0)

    Thx for the 'good oil' Cheerz.

    I'm not anywhere up to speed with this openprocess & getexitcodeprocess stuff but I'm assuming that it is windows stuff. Is that right? Is there a good reference where I can read up on this?

    Also, the loop while I wait for the compile to finish - doesn't that chew up processing capacity?

    Tim
    (Location Australia, then UK, but now USA. Heart, outlook, attitude, etc always Australian)
    Quote: "All Happiness is the release of internal pressure"

  7. #7
    New Lounger
    Join Date
    Sep 2001
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB prog to compile VB (VB 6.0)

    If you want a book, Dan Applemens "Visual Basic Programmers Guide to the Win32 API" is very good. Other than that there are probably a few good websites around.

    If you throw a do events in to the loop, you should be ok.

    Al

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VB prog to compile VB (VB 6.0)

    Can't help you there. I make sloth a policy and pay for stuff like that because I don't have time to figure it out for myself. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •