Features, discussions, tips, tricks, questions, problems and feedback

How to use a custom DLL with common / reusable functions within scripting

To create a common set of functions and reuse them across graphic forms in the SmartUI:

  1. From within Visual Studio, create a new project and choose class library
  2. Add the functions you require, if you need to access any of the namespaces that you normally have available in scripting remember to add the references to your class library as well.
  3. Add the compiled DLL as a reference in your script.

More detailed explanation from Visual Studio:

  1. Create a class library project (this could be C#, VB.Net or any other .NET language you choose for your class library, the example here is C#):

  1. If you would like to use existing SmartUI references, remember to add them:

Once you have created your DLL, just add it as a reference from within your script.

1 Like

If you would like to use a common set of functions throughout multiple graphic forms and you would like to use the same instance of a class, consider using the singleton design pattern so that the same instance of the class is returned for all graphic forms requesting it:

public class MyUtilitiesClass
{
	private static MyUtilitiesClass _instance;
	public MyUtilitiesClass GetInstance()
	{
		if (_instance == null)
		{
			_instance = new MyUtilitiesClass();
		}
		return _instance;
	}

//put the rest of your functions and common variables here

}

Now add this DLL as a reference in your graphic form scripts and access the same instance from different graphic forms.

1 Like

This can also be used to set Global User Interface variables. In this way you can manage and track user interaction by setting variables as the user interacts with the system.

1 Like

Dear Frits and other forum leaders,

I’m new to MAPS.
I need very much to use reusable class libraries (dll).
I’ve used reusable class libraries in C# projects before.
But with MAPS I cannot use as you explained here.

I’ve created a class library in Visual Studio (C# .NET 4.0)
Referenced the created dll to the MAPS script (Grapghic Form script).
But when I running the form it does nothing.
It doesn’t even catching exceptions.

Please could you please guide a little more.
Looking for your reply

ebakyt:

other forum leaders,

I’m new to MAPS.

I need very much to use reusable class libraries (dll).

I’ve used reusable class libraries in C# projects before.

But with MAPS I cannot use as you explained here.

I’ve created a class library in Visual Studio (C# .NET 4.0)

Referenced the created dll to the MAPS script (Grapghic Form script).

But when I running the form it does nothing.

It doesn’t even catching exceptions.

Please could you please guide a little more.

Looking for your reply

Put Your dll under C:\Program Files (x86)\Adroit Technologies\MAPS and try running the graphic form under MAPS Designer - if there is something missing, You will see the error in output window.

1 Like

两个鬼故事给龙凤胎宝宝起名字好起名的好网站属猪的孩子用什么字起名wifi共享大师属马取名起名大全宜用字大全鸡店起名新生儿起名测名免费青春抛物线电视剧贾性女孩起名五行在线起名男孩子起名带木带水大全小饭店起来个什么名字欧洲足球频道直播公司起名网 周易wps2010国家计生委圆桌武士nxgx.com我想看美女室外健身器材的起名羽绒服品牌起名姓郭的的起名龙凤胎起名字起名海字的姓惠起什么名字好听怎么让名字和数字一起排序用王姓起名大全周易起名软件注册机目前甘姓人口女宝宝起名名扬天下网起名大全少年生前被连续抽血16次?多部门介入两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”淀粉肠小王子日销售额涨超10倍高中生被打伤下体休学 邯郸通报单亲妈妈陷入热恋 14岁儿子报警何赛飞追着代拍打雅江山火三名扑火人员牺牲系谣言张家界的山上“长”满了韩国人?男孩8年未见母亲被告知被遗忘中国拥有亿元资产的家庭达13.3万户19岁小伙救下5人后溺亡 多方发声315晚会后胖东来又人满为患了张立群任西安交通大学校长“重生之我在北大当嫡校长”男子被猫抓伤后确诊“猫抓病”测试车高速逃费 小米:已补缴周杰伦一审败诉网易网友洛杉矶偶遇贾玲今日春分倪萍分享减重40斤方法七年后宇文玥被薅头发捞上岸许家印被限制高消费萧美琴窜访捷克 外交部回应联合利华开始重组专访95后高颜值猪保姆胖东来员工每周单休无小长假男子被流浪猫绊倒 投喂者赔24万小米汽车超级工厂正式揭幕黑马情侣提车了西双版纳热带植物园回应蜉蝣大爆发当地回应沈阳致3死车祸车主疑毒驾恒大被罚41.75亿到底怎么缴妈妈回应孩子在校撞护栏坠楼外国人感慨凌晨的中国很安全杨倩无缘巴黎奥运校方回应护栏损坏小学生课间坠楼房客欠租失踪 房东直发愁专家建议不必谈骨泥色变王树国卸任西安交大校长 师生送别手机成瘾是影响睡眠质量重要因素国产伟哥去年销售近13亿阿根廷将发行1万与2万面值的纸币兔狲“狲大娘”因病死亡遭遇山火的松茸之乡“开封王婆”爆火:促成四五十对奥巴马现身唐宁街 黑色着装引猜测考生莫言也上北大硕士复试名单了德国打算提及普京时仅用姓名天水麻辣烫把捣辣椒大爷累坏了

两个鬼故事 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化