我可以在Visual Basic中使用C ++函数吗?

编程入门 行业动态 更新时间:2024-10-11 01:17:45
本文介绍了我可以在Visual Basic中使用C ++函数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是一个新的编程,但我已经做了一个很好的库用于计算数学问题,如二次方程和许多其他。 现在我遇到了一个朋友,他在VB中编程了一些,我们正在考虑是否可以将我的函数从C ++导入他的代码,所以他们可以在需要时调用它们,所以我们可以做一个计算器? 我们如何做?

I'm kinda new to programming, but I have made quite a good library for calculating Math problems like Quadratic Equations and many other. Now I met a friend, and hes programming a little in VB, and we were thinking if it is possible to import my functions from C++ to his code, so he can call them, when they are needed, so we can make a calculator? How can we do that?

  • Janman

编辑:我的朋友正在使用VB 编辑:我的库以自由的函数组织。

My friend is using VB My library is organized in free functions.

推荐答案

要使用VB中的C ++代码,您有以下可能性:

to use C++ code from VB you have the following possibilities:

  • 并从VB调用它们

  • Create DLL where you export functions; and invoke them from VB like this

Declare Sub test Lib "c:\somepath\test.dll" (ByVal a As String, ByVal b As String, c As Long)

  • MFC或任何其他库,并在VB项目中引用dll,这个解决方案是最好的你可以使用C ++ Com组件作为VB代码中的类。

  • Create Com component with ATL or MFC or any other library , and reference the dll in VB project, and this solution is the best you can use C++ Com components as classes in your VB code.

  • 更多推荐

    我可以在Visual Basic中使用C ++函数吗?

    本文发布于:2023-10-26 17:53:20,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1530902.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:函数   Visual   Basic

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!