Standalone EXE in VB6

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wog George

    Standalone EXE in VB6

    I need to create an EXE that is truly "standalone ". By that, I mean the
    executable file is all that's required for the application to run. My app
    has a button that fires up a common control (to select a file), and this
    seems to be my stumbling block. When I try to run my program on another
    machine, it complains that comdlg32.ocx is not registered properly.

    Short of creating my own form and writing my own code to browse for a file,
    can VB6 create a fully self-contained EXE that uses a common control and can
    simply be run without the need for the program to be installed? It was
    suggested to me that VB6 was what I needed (was using VB5 prior to now), so
    I bought an old copy of VB6 Enterprise especially for the occasion. Have I
    been misled?

    --
    George
    "You can just hang outside in the sun all day tossing a ball around, or you
    can sit at your computer and do something that matters." - Eric Cartman - 4
    October 2006


  • Jan Hyde

    #2
    Re: Standalone EXE in VB6

    "Wog George" <wog-NotThisBit-george@amd-p.com>'s wild
    thoughts were released on Wed, 20 Dec 2006 11:32:18 GMT
    bearing the following fruit:
    >I need to create an EXE that is truly "standalone ". By that, I mean the
    >executable file is all that's required for the application to run. My app
    >has a button that fires up a common control (to select a file), and this
    >seems to be my stumbling block. When I try to run my program on another
    >machine, it complains that comdlg32.ocx is not registered properly.
    >
    >Short of creating my own form and writing my own code to browse for a file,
    >can VB6 create a fully self-contained EXE that uses a common control and can
    >simply be run without the need for the program to be installed? It was
    >suggested to me that VB6 was what I needed (was using VB5 prior to now), so
    >I bought an old copy of VB6 Enterprise especially for the occasion. Have I
    >been misled?
    You've been mislead.

    What do you have against creating a setup program though?





    Jan Hyde (VB MVP)

    --
    Aorta: Something you should do. (Stan Kegel)

    Comment

    • Dean Earley

      #3
      Re: Standalone EXE in VB6

      Wog George wrote:
      I need to create an EXE that is truly "standalone ". By that, I mean the
      executable file is all that's required for the application to run. My app
      has a button that fires up a common control (to select a file), and this
      seems to be my stumbling block. When I try to run my program on another
      machine, it complains that comdlg32.ocx is not registered properly.
      >
      Short of creating my own form and writing my own code to browse for a file,
      can VB6 create a fully self-contained EXE that uses a common control and can
      simply be run without the need for the program to be installed? It was
      suggested to me that VB6 was what I needed (was using VB5 prior to now), so
      I bought an old copy of VB6 Enterprise especially for the occasion. Have I
      been misled?
      Common Controls is NOT the same as Common Dialogs.
      The file browse dialog is one of the latter and a LOT easier to create
      without the OCX than a common Control is.

      There are plenty of examples that use the Common Dialog API directly:


      Please note that any EXE created in VB6 still has a dependency on the
      VB6 runtimes, but they exist on pretty much every computer now anyway
      (and are included by default on XP and above)

      --
      Dean Earley (dean.earley@ic ode.co.uk)
      i-Catcher Development Team

      iCode Systems

      Comment

      • Dikkie Dik

        #4
        Re: Standalone EXE in VB6

        Wog George wrote:
        I need to create an EXE that is truly "standalone ". By that, I mean the
        executable file is all that's required for the application to run.
        As a VB6 executable will at least need MSVBVM60.DLL, this is impossible.
        BUT, if you put this DLL in the same directory as the executable (or in
        another path that is searched for execution, like C:\windows\), it will
        run. So you can write an installer in VB6 without having to install your
        installer.
        That is, if the programmer did not add any other dependencies. Trouble
        is, that the IDE sometimes adds dependencies without warning you. Just
        check the project properties and remove anything you will not need.
        My app
        has a button that fires up a common control (to select a file), and this
        seems to be my stumbling block. When I try to run my program on another
        machine, it complains that comdlg32.ocx is not registered properly.
        If you use an object for a file dialog, you do have a dependency. You
        can avoid this by using an API call instead of a CommonDialog control
        and save yourself a lot of troubles.
        Short of creating my own form and writing my own code to browse for a file,
        can VB6 create a fully self-contained EXE that uses a common control and can
        simply be run without the need for the program to be installed? It was
        suggested to me that VB6 was what I needed (was using VB5 prior to now), so
        I bought an old copy of VB6 Enterprise especially for the occasion. Have I
        been misled?
        Probably. There's little difference between VB5 and VB6 in this respect.

        Best regards

        Comment

        • Wog George

          #5
          Re: Standalone EXE in VB6


          "Jan Hyde" <StellaDrinker@ REMOVE.ME.uboot .comwrote in message
          news:rqbio2lmoe nrrpe32ve0s3ei2 s2fm5cogr@4ax.c om...
          "Wog George" <wog-NotThisBit-george@amd-p.com>'s wild
          thoughts were released on Wed, 20 Dec 2006 11:32:18 GMT
          bearing the following fruit:
          >
          >>I need to create an EXE that is truly "standalone ". By that, I mean the
          >>executable file is all that's required for the application to run. My app
          >>has a button that fires up a common control (to select a file), and this
          >>seems to be my stumbling block. When I try to run my program on another
          >>machine, it complains that comdlg32.ocx is not registered properly.
          >>
          >>Short of creating my own form and writing my own code to browse for a
          >>file,
          >>can VB6 create a fully self-contained EXE that uses a common control and
          >>can
          >>simply be run without the need for the program to be installed? It was
          >>suggested to me that VB6 was what I needed (was using VB5 prior to now),
          >>so
          >>I bought an old copy of VB6 Enterprise especially for the occasion. Have
          >>I
          >>been misled?
          >
          You've been mislead.
          >
          What do you have against creating a setup program though?
          >
          >
          The program will be run on a couple of PC's in a corporate environment. The
          users don't have administration rights to install the application, and the
          project would be over by the time I went through the flaming hoops to get it
          released through official channels. The idea was to just copy the file to
          the users home directory or even run it from a flash drive.

          All the program does is parse a huge text file and report the bits that we
          are interested in. It started life as VBA in Word 2003, but it was somewhat
          cumbersome and became more cumbersome as I added more features. I just
          picked up the code, dumped it into VB5, and through a form over the top of
          it. It seemed like a marvellous idea at the time, but now I can only run it
          at home.

          --
          George
          "In the outside world I am a simple geologist, but in here I am Falcor,
          Defender of the Alliance." - Randy Marsh - 4 October 2006


          Comment

          • Wog George

            #6
            Re: Standalone EXE in VB6


            "Dean Earley" <dean.earley@ic ode.co.ukwrote in message
            news:45893f79$0 $2447$db0fefd9@ news.zen.co.uk. ..
            Wog George wrote:
            >I need to create an EXE that is truly "standalone ". By that, I mean the
            >executable file is all that's required for the application to run. My
            >app has a button that fires up a common control (to select a file), and
            >this seems to be my stumbling block. When I try to run my program on
            >another machine, it complains that comdlg32.ocx is not registered
            >properly.
            >>
            >Short of creating my own form and writing my own code to browse for a
            >file, can VB6 create a fully self-contained EXE that uses a common
            >control and can simply be run without the need for the program to be
            >installed? It was suggested to me that VB6 was what I needed (was using
            >VB5 prior to now), so I bought an old copy of VB6 Enterprise especially
            >for the occasion. Have I been misled?
            >
            Common Controls is NOT the same as Common Dialogs.
            The file browse dialog is one of the latter and a LOT easier to create
            without the OCX than a common Control is.
            >
            There are plenty of examples that use the Common Dialog API directly:

            >
            Please note that any EXE created in VB6 still has a dependency on the VB6
            runtimes, but they exist on pretty much every computer now anyway (and are
            included by default on XP and above)
            >
            >
            Thanks very much for that. I'll give that a go and see where I end up.

            --
            George
            "If I don't see you in the future, I'll see you in the past" - Tommy Bolin -
            Melbourne 1975



            Comment

            • Wog George

              #7
              Re: Standalone EXE in VB6


              "Dikkie Dik" <nospam@nospam. orgwrote in message
              news:45898733$0 $21920$bf4948fe @news.tele2.nl. ..
              Wog George wrote:
              >I need to create an EXE that is truly "standalone ". By that, I mean the
              >executable file is all that's required for the application to run.
              >
              As a VB6 executable will at least need MSVBVM60.DLL, this is impossible.
              BUT, if you put this DLL in the same directory as the executable (or in
              another path that is searched for execution, like C:\windows\), it will
              run. So you can write an installer in VB6 without having to install your
              installer.
              That is, if the programmer did not add any other dependencies. Trouble is,
              that the IDE sometimes adds dependencies without warning you. Just check
              the project properties and remove anything you will not need.
              >
              > My app has a button that fires up a common control (to select a file),
              >and this seems to be my stumbling block. When I try to run my program on
              >another machine, it complains that comdlg32.ocx is not registered
              >properly.
              >
              If you use an object for a file dialog, you do have a dependency. You can
              avoid this by using an API call instead of a CommonDialog control and save
              yourself a lot of troubles.
              >
              I wanted a dialog and did what looked like the right thing. It certainly
              worked from a development perspective. The API path to happiness is the
              next one that I'll travel.
              >Short of creating my own form and writing my own code to browse for a
              >file, can VB6 create a fully self-contained EXE that uses a common
              >control and can simply be run without the need for the program to be
              >installed? It was suggested to me that VB6 was what I needed (was using
              >VB5 prior to now), so I bought an old copy of VB6 Enterprise especially
              >for the occasion. Have I been misled?
              >
              Probably. There's little difference between VB5 and VB6 in this respect.
              >
              VB6 was probably not a complete waste anyway, because it can do a few more
              things or do things in better or nicer ways than VB5. It just seems a bit
              odd that I bought the Enterprise Edition to create a 94kB file, but that's
              the version that became available at the same time that I went looking.

              Thanks for the reply, and merry Christmas to all who stumble across this
              thread.

              --
              George
              "You can just hang outside in the sun all day tossing a ball around, or you
              can sit at your computer and do something that matters." - Eric Cartman - 4
              October 2006

              Best regards

              Comment

              • Wog George

                #8
                Re: Standalone EXE in VB6


                "Wog George" <wog-NotThisBit-george@amd-p.comwrote in message
                news:99qih.1127 6$HU.70@news-server.bigpond. net.au...
                >
                >
                I just picked up the code, dumped it into VB5, and through a form over
                the top of it.
                >
                >
                Maybe even threw a form over it too...

                --
                George
                "Strike me down while you can, but it won't make your dried up ovaries any
                more fertile." - Eric Cartman - 3 May 2006


                Comment

                • J French

                  #9
                  Re: Standalone EXE in VB6

                  On Wed, 20 Dec 2006 11:32:18 GMT, "Wog George"
                  <wog-NotThisBit-george@amd-p.comwrote:
                  >I need to create an EXE that is truly "standalone ". By that, I mean the
                  >executable file is all that's required for the application to run. My app
                  >has a button that fires up a common control (to select a file), and this
                  >seems to be my stumbling block. When I try to run my program on another
                  >machine, it complains that comdlg32.ocx is not registered properly.
                  >Short of creating my own form and writing my own code to browse for a file,
                  >can VB6 create a fully self-contained EXE that uses a common control and can
                  >simply be run without the need for the program to be installed? It was
                  >suggested to me that VB6 was what I needed (was using VB5 prior to now), so
                  >I bought an old copy of VB6 Enterprise especially for the occasion. Have I
                  >been misled?
                  You have been misled.

                  VB5 is fine for what you are doing
                  - VB6 is VB5 with a few more bells and whistles

                  As others have pointed out, you can use the API
                  - I ran into exactly the same problem, as I refuse to use OCXes

                  Get the downloadable API Guide (packed with examples) from
                  Your #1 source for using API-functions in Visual Basic and classes for the .NET runtime!


                  You'll probably find an OpenFile API implementation on Rany's site




                  Comment

                  • Wog George

                    #10
                    Re: Standalone EXE in VB6


                    "Dean Earley" <dean.earley@ic ode.co.ukwrote in message
                    news:45893f79$0 $2447$db0fefd9@ news.zen.co.uk. ..
                    Wog George wrote:
                    >I need to create an EXE that is truly "standalone ". By that, I mean the
                    >executable file is all that's required for the application to run. My
                    >app has a button that fires up a common control (to select a file), and
                    >this seems to be my stumbling block. When I try to run my program on
                    >another machine, it complains that comdlg32.ocx is not registered
                    >properly.
                    >>
                    >Short of creating my own form and writing my own code to browse for a
                    >file, can VB6 create a fully self-contained EXE that uses a common
                    >control and can simply be run without the need for the program to be
                    >installed? It was suggested to me that VB6 was what I needed (was using
                    >VB5 prior to now), so I bought an old copy of VB6 Enterprise especially
                    >for the occasion. Have I been misled?
                    >
                    Common Controls is NOT the same as Common Dialogs.
                    The file browse dialog is one of the latter and a LOT easier to create
                    without the OCX than a common Control is.
                    >
                    There are plenty of examples that use the Common Dialog API directly:

                    >
                    Please note that any EXE created in VB6 still has a dependency on the VB6
                    runtimes, but they exist on pretty much every computer now anyway (and are
                    included by default on XP and above)
                    >
                    >
                    This is a follow up after my earlier reply. I followed your google search
                    link, and ended up copying a sample of code from Microsoft and it worked in
                    my app with very little modification. The control has been deleted, and the
                    new version of the app is tested, compiled and ready for me to try tomorrow
                    morning when I get to work.

                    Thanks again for your help.

                    --
                    George
                    "I just wonder if I could get a baby real quick?" - Hat McCullough - 10 July
                    2002


                    Comment

                    • Wog George

                      #11
                      Re: Standalone EXE in VB6


                      "J French" <erewhon@nowher e.ukwrote in message
                      news:458a42c1.1 943680@news.btc lick.com...
                      On Wed, 20 Dec 2006 11:32:18 GMT, "Wog George"
                      <wog-NotThisBit-george@amd-p.comwrote:
                      >
                      >>I need to create an EXE that is truly "standalone ". By that, I mean the
                      >>executable file is all that's required for the application to run. My app
                      >>has a button that fires up a common control (to select a file), and this
                      >>seems to be my stumbling block. When I try to run my program on another
                      >>machine, it complains that comdlg32.ocx is not registered properly.
                      >
                      >>Short of creating my own form and writing my own code to browse for a
                      >>file,
                      >>can VB6 create a fully self-contained EXE that uses a common control and
                      >>can
                      >>simply be run without the need for the program to be installed? It was
                      >>suggested to me that VB6 was what I needed (was using VB5 prior to now),
                      >>so
                      >>I bought an old copy of VB6 Enterprise especially for the occasion. Have
                      >>I
                      >>been misled?
                      >
                      You have been misled.
                      >
                      VB5 is fine for what you are doing
                      - VB6 is VB5 with a few more bells and whistles
                      >
                      As others have pointed out, you can use the API
                      - I ran into exactly the same problem, as I refuse to use OCXes
                      >
                      My problem is now fixed using the API, as suggested.
                      Get the downloadable API Guide (packed with examples) from
                      Your #1 source for using API-functions in Visual Basic and classes for the .NET runtime!

                      >
                      Thanks for the link. I'm sure there'll be lots of fun and headaches in that
                      lot.
                      You'll probably find an OpenFile API implementation on Rany's site

                      >
                      >
                      The more, the merrier.

                      Thanks

                      --
                      George
                      "I got such a raging clue that I almost shot clue goo all over Joe." - Frank
                      Hardly - 11 October 2006
                      >

                      Comment

                      • J French

                        #12
                        Re: Standalone EXE in VB6

                        On Thu, 21 Dec 2006 08:37:46 GMT, "Wog George"
                        <wog-NotThisBit-george@amd-p.comwrote:

                        <snip>
                        >Get the downloadable API Guide (packed with examples) from
                        >http://www.mentalis.org/agnet/
                        >>
                        >Thanks for the link. I'm sure there'll be lots of fun and headaches in that
                        >lot.
                        The API Guide is amazingly good
                        - the examples are simple and work

                        You'll have a great deal of painless fun with it


                        Comment

                        • Antony Clements

                          #13
                          Re: Standalone EXE in VB6

                          yes there is actually, when you use the package and deployment wizard you
                          can add files like comdlg32.ocx to the package so that when the application
                          is installed all relevant ocx and dll files are installed on the client
                          machine as well. alternately, if the destination machine also has the VB6
                          runtime libraries on it, then you can just port the EXE and it will work
                          fine because all the OCX and DLL files would already be on the machine.

                          "Wog George" <wog-NotThisBit-george@amd-p.comwrote in message
                          news:6b9ih.1094 7$HU.2692@news-server.bigpond. net.au...
                          >I need to create an EXE that is truly "standalone ". By that, I mean the
                          >executable file is all that's required for the application to run. My app
                          >has a button that fires up a common control (to select a file), and this
                          >seems to be my stumbling block. When I try to run my program on another
                          >machine, it complains that comdlg32.ocx is not registered properly.
                          >
                          Short of creating my own form and writing my own code to browse for a
                          file, can VB6 create a fully self-contained EXE that uses a common control
                          and can simply be run without the need for the program to be installed?
                          It was suggested to me that VB6 was what I needed (was using VB5 prior to
                          now), so I bought an old copy of VB6 Enterprise especially for the
                          occasion. Have I been misled?
                          >
                          --
                          George
                          "You can just hang outside in the sun all day tossing a ball around, or
                          you can sit at your computer and do something that matters." - Eric
                          Cartman - 4 October 2006
                          >
                          >

                          Comment

                          • Dean Earley

                            #14
                            Re: Standalone EXE in VB6

                            news:6b9ih.1094 7$HU.2692@news-server.bigpond. net.au...
                            >I need to create an EXE that is truly "standalone ". By that, I
                            >mean the executable file is all that's required for the application
                            > to run. My app has a button that fires up a common control (to
                            >select a file), and this seems to be my stumbling block. When I
                            >try to run my program on another machine, it complains that
                            >comdlg32.ocx is not registered properly.
                            >
                            yes there is actually, when you use the package and deployment wizard
                            you can add files like comdlg32.ocx to the package so that when the
                            application is installed all relevant ocx and dll files are installed
                            on the client machine as well. alternately, if the destination
                            machine also has the VB6 runtime libraries on it, then you can just
                            port the EXE and it will work fine because all the OCX and DLL files
                            would already be on the machine.
                            That OCX file mentioned is not a standard VB runtime and is NOT
                            guaranteed to be installed in any circumstance.

                            --
                            Dean Earley (dean.earley@ic ode.co.uk)
                            i-Catcher Development Team

                            iCode Systems

                            Comment

                            Working...