From: dave@powerbasic.com (Dave Navarro)
Subject: Re: Using PB/DLL 2.0 with OS/2
Brian,
In my personal opinion, PB/DLL is a great product. As long as you understand
what the product was designed for and you are willing to take the time to
experiment and learn how to use it, you can do some amazing things with it.
PB/DLL was designed as an add-on to Visual Basic. The documentation reflects
this design point as it primarily deals with creating DLLs and interfacing
with VB. However, as many people have discovered, it isn't limited to this
capacity. You can also create stand-alone applications with it.
Visual Basic makes it easy to create applications by providing you with a
visual "drag and drop" interface. You have a blank window and you drag
controls, such as buttons and edit boxes, onto the window. Visual Basic then
creates empty Subs and Functions for your controls that you simply fill in
with code when you want something to occur (such as when a button is
ressed).
Behind the scenes, VB handles all of the "messages" which are sent to your
window (or form in VB parlance).
While it makes it easy to create visual applications, you lose a measure of
control since you can't access that "hidden code" generated by VB to handle
the form.
With PB/DLL, you are required to write that "hidden code" yourself. This
ode
is called a "callback". In a callback, your code process messages sent by
Windows when anything happens to your "window". Such as minimizing,
maximizing, button presses, etc. It's really not that much code and its very
easy to write (if a bit tedious).
Once major advantage to using PB/DLL to write all of your code is the speed
and size of code generated by PB/DLL. A simple "Hello, World" application
written in Visual Basic requires nearly two megabytes of disk space when you
include the run-time modules that have to be distributed with all VB
applications. PB/DLL, on the other hand, does not require any run-times of
any kind. So the same "Hello, World" program takes around 4k.
Using both the 16-bit and 32-bit PB/DLL compilers, we've written dozens of
stand-alone programs which we use in-house and there are lots of examples on
the disks and downloadable from our FTP site.
Very soon now, we'll be releasing two new products which will really come in
handy. The first is PowerGen.
PowerGen is a Rapid Application Development program which will help you to
write stand-alone programs with PB/DLL. Using the Microsoft Dialog Editor
which comes with PB/DLL, or any other dialog/resource editor, you can
isually
design the look of your application. Much like you do in Visual Basic.
hen,
PowerGen will examine the resulting "standard resource" file and generate the
necessary PB/DLL source code to display the dialogs and windows. Including
all of the callbacks and event message handlers for all of the controls.
Just like Visual Basic, you then simply fill in the empty Functions for each
of the controls in your dialog. Unlike Visual Basic however, no code is
hidden from you and you have total access to all messages and events. This
s
truly a revolutionary product.
The second is the PowerBASIC Console Compiler. In both Windows 95 and
indows
NT you can create what are called "console" applications. When you click on
"MSDOS Prompt" you are given a console. From this console you can execute
OS
programs, batch files, or console programs. A console program is simply a
"true" Windows application which uses the text screen of a DOS box, much like
PB/DOS programs do.
Using PB/CC you can move your existing "text mode" DOS applications into
Windows 95 and Windows NT to gain many advantages. Your interface remains
he
same since consoles are text mode just like DOS. Your program becomes a
32-bit protected mode application, giving you access to 2 gigabytes of flat
memory. And since your program is a true Windows application, you can call
the Win32 API. Including making calls to DLLs such as third-party internet
controls or raw Winsock calls.
Imagine running your current DOS programs in Windows 95/NT and no longer
having to worry about memory constraints and being able to add internet
support. For example, we're porting our internal accounting software to
B/CC
so that it keeps the familiar interface we've all grown used to. However,
when it's done we'll be able to send email notices to customers from right
inside the accounting software. No more opening up a seperate email program
and cutting and pasting from one program to the other.
And porting to PB/DLL is very simple:
$COMPILE CONSOLE
FUNCTION Main()
PRINT "Hello, World!"
END FUNCTION
Or we can get a little fancy:
$COMPILE CONSOLE
FUNCTION Main()
Continued with next message...
*** QwkNews (tm) v2.1
* [TN71] Toast House Import
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|