Does COM method return S_OK?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • techie

    Does COM method return S_OK?

    I have an unmanaged VC++ application calls a COM object which will be
    implemented in C#.

    The VC++ call is:

    BOOL res;
    VERIFY( importFilt->Import(&res) == S_OK );

    My C# method is:

    public int Import()
    {
    // TODO: Add ValidatorImport .Import implementation
    return iVal;
    }

    Will my VC++ code actually succeed? Does the C# Import() method return S_OK
    by default? Or is the return value value iVal?



  • Mattias Sjögren

    #2
    Re: Does COM method return S_OK?

    [color=blue]
    >Will my VC++ code actually succeed? Does the C# Import() method return S_OK
    >by default?[/color]

    Yes, as long as no exception is thrown.

    [color=blue]
    >Or is the return value value iVal?[/color]

    No, that's returned through an extra [out,retval] parameter.



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.

    Comment

    Working...