Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

fromm VB to a DLL written in Visual C++.

What I need to know is how to pass a string type, by reference and as
a parameter, fromm VB to a DLL written in Visual C++. Right now I am
trying it and I am not getting values back from the dll even though I
get the values when I either debug the dll or run it from a driver app
compiled in C. The C app was compiled as a standard DLL. I also tried
it as a COM DLL and I got the same issue.

The problem is that I have a VB client app accessing a Visual C++
standard DLL. The client app needs to send a string values to the dll
and have the dll update these values for later use by the client app.

I can contact the dll and get the values it's just that when it gets
back to the client app it is gibberish. I have tried just sending the
string on way and I realise that C++ arrays and VB strings have
compatability issues.
1 Solution
=Short version=
How To Pass a String Between Visual Basic and Your C DLL

=Long Version=
How to pass arrays and strings between Visual Basic and C functions or between Visual Basic and C++ functions by using Visual Basic 6.0
How are you referencine your DLL?

Are you doing it thru References from the Project Menu or are you referencing as you would an API?
struggling_coder_3203Author Commented:
Referencing as I would an API. Most of my testing was done when I
compiled the C++ project as a standard DLL. So I accessed it as I
would windows API.

I also tested it, though not as thoroughly, when I compiled the
project as a COM dll. I think I still had similar issues. Of course at
that time I made a reference from the Project menu.


Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now