Re: VB6 DLL
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Sun, 19 Aug 2007 20:12:12 -0700
"Jonathan" <Jonathan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4C9B85FF-C804-49B1-A5B5-2327CC9174D2@xxxxxxxxxxxxxxxx
Hi,
I would like to make a DLL in VB6 that interfaces with a VB6 EXE. My concern
is that my DLL will be performing long operations with the serial port that
could take up to 2 minutes. My VB6 EXE needs to have some way to update its
GUI with the progress of the operation. After the long process, the DLL needs
to give the EXE data in a large array. I'm a little worried about threading
in VB6.
Well you should be. With a few exceptions, a VB app is strictly single threaded,
and in particular will explode if a second thread attempts to do anything to its
GUI elements.
An ActiveX DLL will not get you another thread. An ActiveX.Exe can do that, but
at the expense of another process as well, with the overhead of marshalling data
between processes, including your large array.
Unless you want to get really hard core about it, it seems to me a better
strategy is to setup the long operation in the main Exe, and then do lots of
work to make sure all processing is in steps, with DoEvents at appropriate
points if needed.
I believe you need to that anyway to work with a serial port effectively. You
typically are waiting for events from the serial port. As you respond to those,
you can update your GUI directly, or, if the code is in a class, raise a
progress event for the main form to receive. You then store the data received,
and go back to waiting for the next serial port event.
.
- Follow-Ups:
- Re: VB6 DLL
- From: Jonathan
- Re: VB6 DLL
- Prev by Date: Re: [VB5) Faster way to read a text file?
- Next by Date: Re: [VB5) Faster way to read a text file?
- Previous by thread: Properties window, BackColor/ForeColor palette tab
- Next by thread: Re: VB6 DLL
- Index(es):
Relevant Pages
|
Loading