Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Aug 18, 2019 8:15 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Declare a Subroutine in a DLL in RB
PostPosted: Sun Jul 31, 2011 4:21 pm 
Offline

Joined: Sun Jul 31, 2011 3:47 pm
Posts: 1
I have read through many of the threads here on using Declare to bring a dynamic link library and its functions into a Real Basic program. But none of them have identified Sub proceedures as I used to use in VB6. in particular, I would build a user interface using VB6 and then write numerical analysis routines using Fortran or C++ and put the subs into a DLL. I would then declare the Subs and their DLL and call the routines.

I have not been successful in doing this with RB. One possible reason is that my Subs pass data to / from VB6 ByRef and not ByVal, except for strings).

Has anyone experience with using RB to call a subroutine out of a DLL?

Declare Sub My_DLL_Subroutine1 Lib "My_DLL.dll" (ByRef Anum1, ByRef Anum2, ByRef Asum)

ColorMan


Top
 Profile  
Reply with quote  
 Post subject: Re: Declare a Subroutine in a DLL in RB
PostPosted: Sun Jul 31, 2011 4:41 pm 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Your DLL calling code wouldn't have worked on VB either.
ByRef is usually fine, but you need to be clear about WHAT you are passing Byref
No good sending a pointer to a variant or a 4 byte integer if you expect the DLL to be able to write to several hundred bytes of a string buffer.

How is the external function declared at source?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group