使用 C++ vb.net 应用程序中的头文件?

发布于 2024-08-16 07:21:10 字数 84 浏览 2 评论 0原文

在 VB.NET 应用程序中使用 C++ 头文件的最简单方法是什么? 我需要访问通过自定义 VB.NET Windows 应用程序的头文件定义的 API。

What is the simplest way to use a C++ header file in a VB.NET application?
I need to access an API defined via the header file for a custom VB.NET windows app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

知你几分 2024-08-23 07:21:10

使用 VB.NET Declare 语句 重新声明 API 函数代码。如果头文件包含类,这将不起作用,您需要 编写包装器< /a> 使它们可用。

Use the VB.NET Declare statement to redeclare the API function in your code. This will not work if the header file contains classes, you'll need to write a wrapper to make those usable.

月下凄凉 2024-08-23 07:21:10

使用 PInvoke Interop Assistant 将 C++ 标头转换为 PInvoke声明。

如果您有 C++ 项目的完整源代码,请使用 C++ 互操作 根据 whunmr 的建议。

Use the PInvoke Interop Assistant to convert the C++ header into PInvoke declarations.

If you have the full source code for the C++ project use C++ Interop as advised by whunmr.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文