Creating a wrapper/dll for my C++ code to interface with VB 
Author Message
 Creating a wrapper/dll for my C++ code to interface with VB


-----------------------------------------------------------------------------

: What I need is someone who can take a piece of C++ source code and
either
: translate it into Visual Basic, or compile a DLL file that can be
called
: from Visual Basic.

For what it's worth, writing a C++ wrapper DLL and a VB front end is
likely to be far cheaper and faster than trying to translate from C++
to VB.
-Joe
-----------------------------------------------------------------

and I am thinking this will partially answer my problem, which is:
I have a program written in C++.  It stores alot of data in memory
throughout it's execution.  I have a VB front end app which would like
to access this data.  Currently, the data from the C++ program is dumped
to a text file, and then the VB program reads the text file into
memory.  (this is obviously a dumb way to do it).  So, if I want the VB
program to access the data that is stored in memory by the C++ program,
should I create a wrapper to the C++ program and create a DLL out of it
that can be accessed by the VB program?

However, I have no idea what it means to create a DLL wrapper to the c++
program. I can code in C++ and VB, and have a basic understanding of how
DLL's work, but, what does it mean to create a wrapper????

Philip



Thu, 03 Jul 2003 16:30:21 GMT  
 Creating a wrapper/dll for my C++ code to interface with VB
You have two approaches -

  1) Create a COM/OCX wrapper that turns the thing into a Control

  2) Just make the thing into a standard CPP DLL
      but use StdCall method of passing all parameters

I recommend method 2 - just turn your app into a standard CPP DLL
run the thing as CPP

When you are happy with it change the DLL exposed call parameters to
using StdCall, test it again in CPP

A little look at the examples downloadable from www.allapi.net
will give you enough to call it from VB

I have heard of one CPP problem - memory allocation when running as a
CPP DLL from VB - but I doubt that this will be a problem - it was
probably spurious.

On Sun, 14 Jan 2001 00:30:21 -0800, Philip Henderson

Quote:


>-----------------------------------------------------------------------------

>: What I need is someone who can take a piece of C++ source code and
>either
>: translate it into Visual Basic, or compile a DLL file that can be
>called
>: from Visual Basic.

>For what it's worth, writing a C++ wrapper DLL and a VB front end is
>likely to be far cheaper and faster than trying to translate from C++
>to VB.
>-Joe
>-----------------------------------------------------------------

>and I am thinking this will partially answer my problem, which is:
>I have a program written in C++.  It stores alot of data in memory
>throughout it's execution.  I have a VB front end app which would like
>to access this data.  Currently, the data from the C++ program is dumped
>to a text file, and then the VB program reads the text file into
>memory.  (this is obviously a dumb way to do it).  So, if I want the VB
>program to access the data that is stored in memory by the C++ program,
>should I create a wrapper to the C++ program and create a DLL out of it
>that can be accessed by the VB program?

>However, I have no idea what it means to create a DLL wrapper to the c++
>program. I can code in C++ and VB, and have a basic understanding of how
>DLL's work, but, what does it mean to create a wrapper????

>Philip



Thu, 03 Jul 2003 19:07:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Referencing data from unmanaged code to managed code in C++ Wrapper class

2. linking C++ codes to VB interface

3. Linking a VB interface to C++ code

4. Help linking VB interface with C++ App code.

5. VB 5.0 to C++ Interface DLL String Problems

6. DLL-Interface Borland C++ to VB - array problems

7. Trouble with interface reference: vb 5 driving C++ 5 atl dll

8. C DLL and VB "wrapper DLL"

9. Create C++ class DLL with VB ?

10. Creating C++ DLL's for VB

11. Create borland c++ dll and call from vb

12. Problem with VB 4.0 using dll created with borland c++

 

 
Powered by phpBB® Forum Software