Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating DLLs for usign them with VBasic

Status
Not open for further replies.

arlequin

Programmer
Sep 21, 1999
232
0
0
UY
I must manage dynamic memory structures like stacks and queues and VB doesn't handle with them...<br>
So I thaught generating a DLL with MS-Visual C++ but I don't know how to tell VB to use it.<br>
<br>
Thanx
 
VB can deal with C DLLs in two main ways:<br>
&nbsp;&nbsp;&nbsp;&nbsp;1) The DLL does Active-X<br>
&nbsp;&nbsp;&nbsp;&nbsp;2) The DLL exports functions (your typical WINAPI function declaration)<br>
Note that VB can't handle the mangling of C++.<br>
<br>
A tougher question might be the datatypes that VB supports. With Active-X, it's not really a problem, since VB knows about all the usual COM datatypes. With the exported function method, you shouldn't have any pointers in your list. It's really difficult, even for experienced VB programmers, to dereference pointers. <br>
<br>
If you are using a pointer for caller-storage, lie to the VB programmers and tell them it's a handle (well, it kindof is, isn't it?), then they would assign it to a LONG variable, and never touch it, just pass it along to other functions you exported.<br>
<br>
Strings can be tough, since when VB calls a C DLL it converts it to ANSI. If you're a Unicode kindof guy, then you'll have to convert it befor using it.<br>
<br>
Ints and floats should be OK, as long as you're on a Intel CPU, but I've never had to pass one to a DLL, myself.<br>
<br>
Chip H.<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top