如何在Visual Basic项目中使用.c文件?(How to use .c file in Visual Basic project?)

编程入门 行业动态 更新时间:2024-10-24 21:31:33
如何在Visual Basic项目中使用.c文件?(How to use .c file in Visual Basic project?)

我需要将C代码转换为Visual Basic。

我有.c.h文件。

有没有办法在Visual Basic应用程序中使用我的.c文件? 应用程序是在Visual Basic 6.0中创建的。

现在我只看到一种方法:手动转换代码。 但是它花了很多时间,因为我以前从不使用VB,所以我需要一些时间来学习语法。 我读了一些关于在VB中使用.dll的信息。 也许有一些方法,例如,从.c创建一个.dll然后在我的应用程序中使用它?

I need to convert C code to Visual Basic.

I have .c and .h files.

Are there some ways to use my .c file in Visual Basic Application? Application was created in Visual Basic 6.0.

Now I see only one way: convert the code manually. But it takes a lot of time because I never use VB before, so I need some time to learn the syntaxes. I read some info about using .dll in VB. Maybe there are some ways, for example, create a .dll from .c and then use it in my application?..

最满意答案

您需要使用多少C代码? 如果它很短,那么一定要手工转换。 如果你将使用那种语言,那么学习VB的好机会。 如果它非常大,请使用导出的函数编译为标准DLL,然后从VB调用它。

(作为上述评论的回答添加)


来自另一条评论的好的补充:如果您确定最佳路由是将C代码编译为DLL并从VB6调用它,您应该阅读此Microsoft文档以了解如何执行此操作。

How much C code do you have to work with? If it is short, then by all means convert it by hand. Good opportunity to learn VB if you will be working in that language anyway. If it is very large, compile to a standard DLL with exported functions, and just call it from VB.

(Added as answer from comment above)


Good addition from another comment: If you do decide that the best route is to compile the C code as a DLL and call it from VB6, you should read this Microsoft document on how to do it.

更多推荐

本文发布于:2023-07-29 18:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1318623.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   项目   如何在   Visual   project

发布评论

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

>www.elefans.com

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