
16Bit Applications with 32Bit VB4 Pro
Quote:
>I have the 32Bit version of VB4 Professional Edition. Can someone please
>tell me if the EXE files I make will work on a 16 Bit platform, or is
>there something I have to do first. I checked out the VB4 page at
>www.microsoft.com and it said that the professional editon of VB4 can
>me know how to to this.
>Thanks,
>Shezan.
Shezan,
I haven't done it, but supposedly this is the procedure (you should find it in
your documentation for VB 4.0 Pro):
1) install both versions of VB 4.0 Pro (16 bit and 32 bit) from your CD.
2) use OCX's (16 bit allows VBX's but 32 bit doesn't)
3) use OCX's that are available in both 16 bit and 32 bit formats. The Windows
95 controls delivered with VB 4.0 (ex. toolbar, rich text box, et.) are ONLY 32
bit, so if you are serious about compiling both a 16 bit app and a 32 bit app
from the same source code, don't use those controls.
4) choose Jet 2.5/3.0 compatibility from Tools/References, because your 16
bit customers won't be able to use Jet 3.0 (it is 32 bit only) (at setup time,
setup wizard will tell you to deliver dao2516.dll with the 16 bit app and
dao3216.dll with the 32 bit app).
5) for any declares you have of API's, use conditional logic to determine
whether 16 bit API or 32 bit API is needed. Win32 and Win16 are reserved words
in the example below.
#If Win32
declare....
#Else
declare....
#EndIf
Be careful. Most 32 bit API's use long and most 16 bit API's use integer. Some
even reverse the sequence of the parameters between the two versions, so check
your code and put conditional logic in wherever it is needed.
6) Finally, bring up the project in both versions of VB 4.0, and compile two
different exe's from the same vbp. One 16 bit and one 32 bit. I haven't done
this, so I don't know if there are any gotcha's from this point on.
Before you bother doing this, be aware that the 16 bit version of VB 4.0 is a
hog. Actually, OLE is a hog all by itself. If you know that your target
environments will have 12 MB RAM or more, you will probably be OK. If they
will have less, then this approach isn't as terrific as MS leads you to
believe. Keep the number of controls on a form to a relatively small number
(i.e. keep your design simple). Otherwise, your repaints will be very slow. Or
just write your apps in VB 3.0. 16 bit applications (all that you were
able to build in VB 3.0) will run in 32 bit environments! Sometimes better
than 32 bit apps that are relying on OLE. OLE is slow.
Carolyn Plette