home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_code2
/
pxcreate
/
pxcreate.txt
< prev
Wrap
Text File
|
1991-07-12
|
2KB
|
33 lines
CONTENTS:
PXCREATE.MAK Visual Basic project file.
PXCREATE.FRM Visual Basic form file.
PXCREATE.EXE Executable generated with Visual Basic.
PXCREATE.TXT This file.
I needed a way to use The Paradox Engine to create Paradox tables in VB. At
first this seemed impossible because VB doesn't provide for arrays of
pointers to strings. The solution is to use arrays of longs. The problem
with this is that basic will not allow conversion of one type to another.
This had me stumped because I could not get the address of a string into
the elements of an array of longs. The solution was to make a Windows API
call that accepts a pointer to a string, and a return value that is also a
pointer to that same string. When you declare the function within VB you
have to LIE to VB about it's return value. Instead of declaring it as
returning a string value you declare it as returning a long. This is not
a problem since they are both the same size. You can now assign the returned
long value to an element of an array of longs and VB will not complain.
When you call the PXTblCreate function you can pass the array to it. Since
arrays are passed by reference you end up passing a pointer to an array
of pointers to strings.
See the code attached to the button in the file "pxcreate.frm".
This code has not been tested very well so it could contain bugs. Use it at
your own risk.
Jim Nech
OurRider Systems - (Producers of Custom Controls for Visual Basic)
3701 Kirby DR. STE. 1196
Houston, TX 77098
Voice:(713)521-0486 Fax:(713)523-0386