如何与dll共享应用程序变量? [英] How can I share app variable with dll?

查看:115
本文介绍了如何与dll共享应用程序变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用具有我所需的所有变量和功能的module1.
我创建了带有窗体和用户界面的formUI.dll.

解决方案

您基本上有两个选择.使用来自窗体dll的反射来访问模块的公共功能,属性等(研究Reflection-并非微不足道),或将模块编译为dll并将其导入到窗体项目中(可能是您看来最好的选择)对此有更多了解.)

快乐编码


My app use a module1 with all variables and functions I need.
I created a formUI.dll with Forms and User Interfaces.
How can the formUI.dll share the variables and functions I have in the app module1?

解决方案

You basically have two options. Use reflection from your forms dll to access the public functions , properties etc of your module(study up Reflection - not trivial), or compile your module as a dll and import it into your forms project (probably the best option as you seem to know more about this).

Happy Coding


这篇关于如何与dll共享应用程序变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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