• VB prog to compile VB (VB 6.0)

    Author
    Topic
    #360869

    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…

    vb6 /runexit /make myapp.vbp
    

    But how do I call that from within VB. I could use shell but that will be very obvious. Is there a better way?

    Viewing 1 reply thread
    Author
    Replies
    • #544485

      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?

      • #544501

        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 ( thinks 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

        • #544509

          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

        • #544544

          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. shrug

    • #544499

      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

      • #544510

        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

        • #544511

          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

    Viewing 1 reply thread
    Reply To: VB prog to compile VB (VB 6.0)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: