我需要将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.
更多推荐
发布评论