473,795 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Dec 20 '06 #1
13 16410
"Wog*George " <wo************ *******@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)

Dec 20 '06 #2
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 (de*********@ic ode.co.uk)
i-Catcher Development Team

iCode Systems
Dec 20 '06 #3
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
Dec 20 '06 #4

"Jan Hyde" <St***********@ REMOVE.ME.uboot .comwrote in message
news:rq******** *************** *********@4ax.c om...
"Wog George" <wo************ *******@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
Dec 21 '06 #5

"Dean Earley" <de*********@ic ode.co.ukwrote in message
news:45******** **************@ 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:
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

Dec 21 '06 #6

"Dikkie Dik" <no****@nospam. orgwrote in message
news:45******** *************** @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

Dec 21 '06 #7

"Wog George" <wo************ *******@amd-p.comwrote in message
news:99******** *******@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
Dec 21 '06 #8
On Wed, 20 Dec 2006 11:32:18 GMT, "Wog*George "
<wo************ *******@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
http://www.mentalis.org/agnet/

You'll probably find an OpenFile API implementation on Rany's site
http://vbnet.mvps.org/

Dec 21 '06 #9

"Dean Earley" <de*********@ic ode.co.ukwrote in message
news:45******** **************@ 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:
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
Dec 21 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2287
by: FilexBB | last post by:
Currently I use jdom-b9 version to parase xml with the following xml message <?xml version="1.0" encoding="UTF-8" standalone="no"?> ...... with the code like this SAXBuilder builder = new SAXBuilder(); InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("test.xml"); Document doc = builder.build(is);
2
5439
by: Lonnie, SRC employee | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** I can figure out how to set the standalone attribute in the <? xml version="1.0 ?> tag eg <?xml version="1.0" standalone="yes" ?> closest I have got to what I need is: <?xml version="1.0" ?> <?standalone yes?> <xpg creator="crusher" version="1.0"> <etr>
9
2051
by: Dan Williams | last post by:
Hi people I'm getting a little annoyed with the way the print function always adds a space character between print statements unless there has been a new line. The manual mentions that "In some cases it may be functional to write an empty string to standard output for this reason." Am I the only the who thinks that this sucks? It's the first thing I've come across in Python that I really think is a design flaw. Is there a good way to...
3
2880
by: Isaac Gouy | last post by:
1) Running a standalone script with SpiderMonkey on Linux js -f scriptfile.js scriptarg How can I get the value of scriptarg from within the JavaScript scriptfile? 2) Running a standalone script with SpiderMonkey on Linux How can I do formated printing to stdout?
0
309
by: tt | last post by:
My mod_python 3.1.4 installation works when Apache 2.0.54 is run in standalone mode (apache -k standalone) but refuses to operate when run as a service (apache -k restart). Logs yield the usual and well-known "make_obcallback: could not import mod_python.apache" error. I have tried PYTHONHOME, LoadFile python24.dll (2.4.2) with no result. I have read *all* threads about make_obcallback that google found. What's even weirder I had this...
2
2366
by: JohnR | last post by:
Hi all. In my program I try to handle all obvious potential errors with structured error handling (try-catch) block. What I would like to do is have an 'overall' error handler that would gracefully catch any unanticipated errors. I created a startup module to place my overall error handling for my "real" program which is Form1. My program is structured like this: Module startup
0
1529
by: sdb1031 | last post by:
I'm trying to learn about Python and XML. I would like to be able to add standalone="no" to my xml declaration when writing an xml file, but I am unable to figure out how. So far, I have the following code: import xml.dom.minidom doc2 = xml.dom.minidom.Document() print doc2.toxml('iso-8859-1') Which produces the following XML declaration: <?xml version="1.0" encoding="iso-8859-1"?>
1
1553
by: VK | last post by:
It is possibly more suitable to address this question to W3C mailing list, but I'm trying here first. Could anyone comment on <http://www.w3.org/TR/REC-xml/#sec-rmd> The first statement says: "If there are external markup declarations but there is no standalone document declaration, the value "no" is assumed."
7
11667
by: tah | last post by:
Hey, Can someone please clarify, confirm, or set me straight on my understanding of a standalone="yes" attribute in the xml version element? I assume it means that the xml document containing it is standalone, and does not refer to any external document to define types. In other words, it doesn't use an external dtd to validate any types - everything used would be defined within the doc itself. In other words, you would never see an xml...
4
2335
by: Ted Lyngmo | last post by:
Hi! I'm new (but please do continue reading) to C++ in the VS environment and wanted to create a standalone program (or preferably, a static library, compatible with other Windows compilers) that; 1. Takes an URI as an argument. 2. Prints the proxy for that URI to stdout (or in the static library case, returns the resulting string).
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10443
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10002
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.