gevjen
gevjen

Reputation: 675

3rd Party dll in Silverlight application

I have a third party dll that I am trying to reference in my Silverlight project. I am able to use this dll and reference it in a test WPF application. Trying to reference this same dll in my silverlight application is not working. I am using the automationFactory class to get a handle on the dll but I am not sure if I am doing this correctly.

dynamic btApp = AutomationFactory.CreateObject("BarTender.Application");

By putting Bartender.Application as the argument in the CreateObject method I am able to get a handle on a dll, but Im afraid it is not the correct dll. How do I reference a particular dll that I need to use.


Code

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);

Upvotes: 1

Views: 1232

Answers (1)

Shawn Mclean
Shawn Mclean

Reputation: 57479

Silverlight is a complete different framework from wpf. You need to get a the dll built for the silverlight runtime.

Reason: WPF is more integrated into windows/.net framework. This Dll may reference system calls. Silverlight has its own framework (very small subset of the .net framework).


Silverlight 4:

If shipping the library: This guy explained it here.


I do not suggest usint COM integration for this purpose (I see something about Print(). Maybe that DLL requires the full .net framework. Not all users of silverlight will have that. Its best if you go WPF.

Upvotes: 1

Related Questions