Discussion Locked

Using CPP File in VB

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I would like to know how can I use the CPP file in VB? How I define it?

5 replies

by wayne m.

You cannot directly use a CPP file in VB. You can compile the CPP file into a DLL or an ActiveX/COM object and call it from VB. Unless your CPP file implements some complex logic or some logic which cannot be implemented in VB, it would probably be more productive to rewrite the code in VB rather than attempt to reuse it.

by rodsherer

The only way to use a C program in VB is to access it as a DLL/COM object. If you want to use the logic without building an object in your VB code, then you are going to have to translate the code into function(s) and/or procedure(s) in a VB module or class.

This discussion is closed to new replies.