C#编写的dll在MFC中的使用 [英] C# written dll use in MFC

查看:56
本文介绍了C#编写的dll在MFC中的使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我用 Class Library 项目在C#中制作了一个dll.
该dll具有一个功能.
然后我使用添加引用 MFC项目中添加了该dll.
然后我定义一个类型为 Mydll :: Class1 的变量.
虽然将此定义放在函数中,但没有问题,但是当我要将其定义为类的全局变量或成员变量时,出现错误.

帮助将提供以下消息:

Hi
i made a dll in C# with Class Library project.
this dll has one function.
then i added this dll in an MFC project with Add Reference.
then i define a variable with type Mydll::Class1.
while this definition is placed in a function, there is no problem but when i want to define it as global or member variable of class i got an error.

the help offers this message:

You can only define CLR objects within function scope



有什么解决方案来定义全局变量?

感谢



is there any solution to define a global variable?

thanks

推荐答案

this link [^]might help you!


这篇关于C#编写的dll在MFC中的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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