locked
How to use COM object in workflow RRS feed

  • Question

  • I am trying to use a COM object (built in C++ ) from within my workflow, but I cannot call any methods on my object from within my workflow.

    The COM object, Session, is declared in my main program and passed to my workflow as part of a larger object (ConversionHost). I can declare a variable of this type in my workflow and can even set the variable to be the Session passed from the ConversionHost.GetSession method, but I cannot call any methods on this object. Nothing shows up in the Intellisense list, and typing in a method tells me it is an unrecognized type.

    The COM object is added as a reference under the References, and I've added it to the Imports list for the workflow as well.

    Is there something else I need to do to use this object?

    Thanks

    Sheri

    Wednesday, November 24, 2010 9:08 PM

Answers

  • Hi,

    As far as I know, WF4 cannot call COM object directly. One possible solution: create a .net wrap of the COM object. then WF4 workflows invoke the method of .net object which can call the COM object.  

    Regards
    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support. My Blog:http://xhinker.com "Microsoft Windows Workflow Foundation 4.0 Cookbook"
    • Marked as answer by Andrew_Zhu Thursday, December 2, 2010 1:53 AM
    Monday, November 29, 2010 3:08 AM