1 Reply Latest reply on Jan 24, 2014 8:35 AM by Daniel Do

    Problem with new API Functionality

    Jim Sculley

      The What's New for 2011 includes the following:

       

      =============================

      IEdmCmdNode

      This  interface is provided in the EdmCmdData.mpoExtra member when you get a call to IEdmAddIn5.OnCmd for a change state operation.  Its purpose is to give the API programmer an opportunity to traverse the entire  assembly tree involved in the operation.

       

      This  interface inherits from IDispatch.

       

      Methods

      Description

      GetProperty

      Returns a  property (such as a list of parent files or child files) of the file in  question.

       

       

      ============================

       

      The docs for GetProperty:

       

      ============================

      IEdmCmdNode::GetProperty

      This  method returns a property of the file described by the EdmCmdData struct from which mpoExtra pointer the IEdmCmdNode interface  came.

       

       

      Prototype

      HRESULT  GetProperty( [in] enum EdmCmdNodeProp eProperty,
                            [in,optional] VARIANT oArg,
                           [out,retval] VARIANT  *poResult );

       

       

      Arguments

      Type

      Description

      eProperty

      enum EdmCmdNodeProp

      Argument  telling what kind of property you want to retrieve

      oArg

      VARIANT

      Reserved  for future use. Must be empty.

      poResult

      VARIANT*

      The  returned value of the property. The type of property depends of the  eProperty argument.

       

      Return  Codes

      Description

      S_OK

      The method  was successfully executed.

       

      ============================

       

      The allowed structure values:

       

      =============================

      EdmCmdNodeProp

      These enum values are used as  parameter to IEdmCmdNode.GetProperty to tell which property to return.

       

      Name

      Value

      Description

      EdmCmdNode_IsTopNode

      1

      (Boolean) True if thw is a top  node

      EdmCmdNode_ChildDocIDs

      2

      (SafeArray of integers) File IDs of  child files

      EdmCmdNode_ParentDocIDs

      3

      (SafeArray of integers) File IDs of  parent files

       

      =============================

       

      I can call GetProperty passing in the IsTopNode value and the call succeeds, returning true or false.

       

      If I try to call GetProperty using ChildDocIDs or ParentDocIDs the call fails with an ArgumentException (Message = "The method returned a COM Variant type that is not Interop compatible.").

       

       

       

       

      Has anyone had success using this new functionality?

       

      Jim S.