Search This Blog

Wednesday, October 13, 2010

Dynamic type in method parameter.

Programmer Question

I am passing in a dynamic type into a method and having some issues running the code. Wondering if you are able to pass a dynamic object into as a parameter using the out keyword.



Below is the code.



dynamic btApp = AutomationFactory.CreateObject("Test.Application");
dynamic btMessages;

dynamic btFormat = btApp.Formats.Open("c:\\Temp/Format1.btw", false, "");
btFormat.SetNamedSubStringValue("testing", "testtest");
btFormat.Print("Job1", true, -1, out btMessages);
btFormat.Close(2);


issue is in the print method. where the last argument is passing in a dynamic object.



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails