dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Passing Parameters by Reference

Question:
I have a function in a DLL that I want to call from VB program. The Dll function has few parameters. Some of them should be passed from vb and some should be return from the dll. For example, I declared the function like Function(A1 as double,A2 as double,B1as double,B2 as string) as integer. Now, the parameters A1, A2, and B1 will be passed to the Dll wheras B2 is a string that should be return by the Dll. You know, calling the function in a way like dummy=Function(A1,A2,B1,B2) will make VB think that I'm passing B2 to the Dll like the other parameters. How can I get B2 back from the Dll ?

Answer:
Take a look at the example using the GetPrivateProfileString API function. This one returns values in the different parameters passed to it. I don't think VB worries about whether or not the parameters are getting filled or not.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date