 | | | | |  | | | | | Guest | Standalone EXE in VB6 -
06-04-2007, 10:33 AM
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 | | | | | | | | Guest | Re: Standalone EXE in VB6 -
06-04-2007, 10:33 AM
"WogÂ*George" <wog-NotThisBit-EMAIL REMOVED>'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) | | | | | | | | Guest | Re: Standalone EXE in VB6 -
06-04-2007, 10:33 AM
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: http://www.google.com/search?hl=en&q...mon+dialog+api
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 (EMAIL REMOVED)
i-Catcher Development Team
iCode Systems | | | | | | | | Guest | Re: Standalone EXE in VB6 -
06-04-2007, 10:33 AM
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 | | | | | | | | Guest | Re: Standalone EXE in VB6 -
06-04-2007, 10:33 AM
"Jan Hyde" <EMAIL REMOVED> wrote in message
news:EMAIL REMOVED...
> "Wog George" <wog-NotThisBit-EMAIL REMOVED>'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 | | | | | | | | Guest | Re: Standalone EXE in VB6 -
06-04-2007, 10:33 AM
"Dean Earley" <EMAIL REMOVED> wrote in message
news:45893f79$0$2447$EMAIL REMOVED...
> 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:
> http://www.google.com/search?hl=en&q...mon+dialog+api
>
> 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 | | | | | | | | Guest | Re: Standalone EXE in VB6 -
06-04-2007, 10:33 AM
"Dikkie Dik" <EMAIL REMOVED> wrote in message
news:45898733$0$21920$EMAIL REMOVED...
> 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 | | | | | | | | Guest | Re: Standalone EXE in VB6 -
06-04-2007, 10:33 AM
"Wog George" <wog-NotThisBit-EMAIL REMOVED> wrote in message
news:99qih.11276$EMAIL REMOVED...
>
>
> 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 | | | | | | | | Guest | Re: Standalone EXE in VB6 -
06-04-2007, 10:33 AM
On Wed, 20 Dec 2006 11:32:18 GMT, "WogÂ*George"
<wog-NotThisBit-EMAIL REMOVED> 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?
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 http://www.mentalis.org/agnet/
You'll probably find an OpenFile API implementation on Rany's site http://vbnet.mvps.org/ | | | | | | | | Guest | Re: Standalone EXE in VB6 -
06-04-2007, 10:33 AM
"Dean Earley" <EMAIL REMOVED> wrote in message
news:45893f79$0$2447$EMAIL REMOVED...
> 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:
> http://www.google.com/search?hl=en&q...mon+dialog+api
>
> 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 | | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |  |