-=> Quoting John Dumas to All <=-
JD> I have been making ( C ) dlls to pass into VB.
JD> For the most part I have had success.
What C++ do you use? I use BC++ 3.1 and VB 3.0 and so far I can't get VB to
recognize the functions. Some reason it says it's not there. I have BC++ set
up so that it exports are all case sensitive, even in linking. I also noticed
that it's not making the function(s) in the DLL "public". Could you tell me
how you did that?
JD> I have tried passing by character arrays by reference but, have only
JD> recieved "y|||||yyy||" garbage when back in VB.
Hmmm... Seems more a problem that needs correcting on the VB side, than the
C++ side. I hope the moderator forgives as I attempt to handle this one from
the VB perspective (just once ;) I don't have it handy to pop up, but does VB
have a "seg" thing like:
SUB ASub(Byval A As Integer, Seg TheVar AS String * 40)
(where you use Seg like ByVal)? I know QuickBasic 4.5 has something like that
so you can pass something by reference from an external library. I found QB
and VB much alike in keywords, but forgot if VB also has that. It may need to
be defined like that in QB to be able to pass by reference. This is often
needed when trying to link to external libraries, esp. those written in C.
Another one is to make sure your functions in the C++ program, if passing
parameters, are declared as _pascal, or in VB declare it as CDECL (if VB has
it, I haven't dabbled much in VB lately).
Tika
The 3:00 am Club: http://www.geocities.com/SiliconValley/Haven/1420/
Tika Carr: tika@knightmoves.com [C/C++ Code, Libraries, Info...]
... This message released to public domain. Use at your own risk.
___ Blue Wave/DOS v2.30
--- QScan/PCB v1.17b / 01-0406
---------------
* Origin: Knight Moves - Rochester,NY 716-865-2106 (1:2613/313)
|