C#,并处理C/C ++标头和类文件 [英] C#, and handling C/C++ Headers and Class Files

查看:86
本文介绍了C#,并处理C/C ++标头和类文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是中级程序员,正在尝试使用从GitHub获得的UI扩展核心库.基本上,我正在编写一个使用该项目核心文件的简单(目前)UI.但是,它们是用C/C ++编写的.我没有线索 如何用C编写代码,但是很明显我是用C#编写的.但是无论如何,我知道有一种将这些类文件包装或导入到我的项目中的方法,因为我看到其他人也这样做,但是不知道如何做.导入后,我可以照常使用其功能和方法.所以我的问题 对于您现有的所有C#专家来说,您是否知道解决方案,或者至少是在正确方向上的指针可以帮助我解决这个问题.任何帮助将是巨大的!谢谢,如果您需要该项目核心的文件,请告诉我!

Hi I'm an intermediate programmer, and am trying to extend a core library with a UI that I have gotten from GitHub. Basically, I'm coding a Simple (for now) UI that uses this project's core files. However, they are written in C/C++. I have no clue how to code in C, but I do in C#, obviously. But anyways, I know there is a way to wrap or import these class files into my project, as I've seen other do the same, but do not know how. Once imported, I can use its functions and methods as normal. SO my question for all you C# gurus out there is, would you know of a solution, or at least a pointer in the right direction as to help me with this. Any help will be great! Thanks, and if you need a file from the core of this project, let me know!

推荐答案

您是否有dll? 那么您只需要执行2个步骤

Do you have a dll?  then you only need to do 2 steps

1)从菜单:项目-添加引用-浏览dll

1) From menu : Project - Add reference - browse for dll

2)使用"using"将dll的名称空间添加到模块顶部.声明.您可以通过打开解决方案资源管理器(菜单视图-解决方案资源管理器)并右键单击在步骤中添加的引用(选择属性)来找到名称空间. 1.它应该是引用的名称.

2) Add the namespace(s) of the dll to the top of your module with a "using" statement.  You can find the namespace by opening the solution explorer (menu View - solution Explorer) and right click on the reference (select properties) you added in step 1.  It should be the name of the reference.


这篇关于C#,并处理C/C ++标头和类文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆