POV-Ray : Newsgroups : moray.win : Another thought... Request? hmm..... : Re: Visual Basic and C++??? Was:[Re: Another thought... Request? hmm.....] Server Time
29 Jul 2024 06:13:49 EDT (-0400)
  Re: Visual Basic and C++??? Was:[Re: Another thought... Request? hmm.....]  
From: Michael
Date: 16 Apr 1999 11:01:24
Message: <941417D0F63BD21184D30080ADA97B89033DF4@michaelpc>
Alex Magidow wrote in message <37167EF1.A69656EB@mninter.net>...
>Sorry, this is offtopic(I mean, really offtopic), but is there any way to
make a
>program consisting of C++ and Visual Basic? I need to do this for
something, as
>I know C++ better(and prefer inheritence), but I need a good way to do
>graphics...I want to import C++ code into Visual Basic 5 somehow...is this
>possible, and can you do function calls, etc?


a) Make the C++ code into a DLL (Should then be called in much the same way
that the Win32 API is called from VB, I guess) with something like

Declare function my_function Lib "MyDLL.dll" alias
"NameOfFunctionInDllExportTable" _
(ByVal hWnd As Long)

b) Use COM automation. That is create a dispatch interface that is
implemented in C++ and then your VB program will be able to call your C++
code in the same way that you call methods and change the properties of the
.ocx controls you use in VB. Well, there's far more to COM than that one
line sentance, but you should be able to find references in your C++ and VB
docs.

Hope that helps.
--
Michael (_leahciM_ at email dot msn dot com).


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.