【发布时间】:2012-01-21 07:53:04
【问题描述】:
我有一个第三方 dll,我试图在我的 Silverlight 项目中引用它。我能够使用这个 dll 并在测试 WPF 应用程序中引用它。尝试在我的 silverlight 应用程序中引用相同的 dll 不起作用。我正在使用自动化工厂类来获取 dll 的句柄,但我不确定我是否正确执行此操作。
dynamic btApp = AutomationFactory.CreateObject("BarTender.Application");
通过将 Bartender.Application 作为 CreateObject 方法中的参数,我可以获得 dll 的句柄,但恐怕它不是正确的 dll。如何引用我需要使用的特定 dll。
代码
dynamic btApp = AutomationFactory.CreateObject("BarTender.Application");
//dynamic btMessages = null;
dynamic btFormat = btApp.Formats.Open("c:\\Temp/Format1.btw", false, "");
btFormat.SetNamedSubStringValue("testing", barcodeValue);
btFormat.Print("Job1");
btFormat.Close(2);
【问题讨论】:
-
我会发表评论:
BarTender需要是已安装的应用程序。 -
问题:你想从这个第 3 方 dll 中得到什么?您打算将此 ddl 与您的 silverlight 项目打包还是假设它将在用户系统上?
-
我希望能够使用他们的打印方法..这是我的代码..dynamic btApp = AutomationFactory.CreateObject("BarTender.Application"); //动态btMessages = null;动态 btFormat = btApp.Formats.Open("c:\\Temp/Format1.btw", false, ""); btFormat.SetNamedSubStringValue("测试",barcodeValue); btFormat.Print("Job1"); btFormat.Close(2);
-
底部的 btFormat.Print 方法不起作用..我没有从他们那里得到正确的 sdk...所以我试图引用他们给我的这个新 dll..但我似乎不能掌握它...
-
AutomationFactory.CreateObject 似乎没有引用正确的 dll...想知道如何获取特定 dll 的句柄。
标签: c# silverlight