帮助C ++和VB [英] Help C++ and VB
问题描述
我正在尝试使用.NET 2003将某些C ++集成到大型VB项目中,如果有人可以帮助我将其集成到VB项目中,那将是非常棒的. br/>
我基本上想要:
========= C ++ =========
公共类CppClass {
公开:
CppClass();
int go(ObjVB * oVB){
oVB-> function1();
oVB-> function2();
.....
};
〜CppClass();
};
========= C ++ =========
======== = VB ===========
Sub VBsub()
Dim myCppClass作为新CppClass
Dim myObjVB作为新ObjVB
Dim num作为整数
num = myCppClas.go(myObjVB)
结束子
========= VB =========
提前感谢..
推荐答案
I forgot to add that the VB code and C++ code are 2 projects in the same solution, i have added refferences to both projects. i have allready made an instance of the C++ class in vb and had it return a number and msgbox the value.
示例:
========== VB ==========
example:
=========VB==========
MsgBox(CppObj.go())
MsgBox(CppObj.go())
========= VB ==== ======
=========VB==========
========== C ++ ==========
int go() {
=========C++==========
int go(){
返回5;
return 5;
}
========= C ++ ==== ======
=========C++==========
基本上,它制作了一个数字为5的msg框.
Basicly it made a msg box with the number 5.
我想我的问题是,是否有可能将VB类对象的实例传递给C ++函数并在c ++函数中对其进行调用,如果您需要任何其他信息,请让我知道或者您知道应在论坛中将其发布在何处.
再次感谢.
I guess my question is, is it possible to pass a instance of a VB class object to a C++ function and make calls to it in the c++ function, if you need any other information just let me know or if you know where this should be posted in the forums.
Thanks again.
这篇关于帮助C ++和VB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!