How to check for a method in COM DLL RRS feed

  • Question

  • Is there a way to programmatically check whether a specified method exists in a COM DLL or not..
    Tuesday, August 13, 2019 5:15 AM

All replies

  • With ITypeLib and ITypeInfo

    You can find old articles like COM Automation: Type Information (Part II)

    Tuesday, August 13, 2019 5:56 AM
  • Hello,

    have a look at this code:

    Or use "dumpbin /export <dllfile>" and analyze the output.

    Regards, Guido

    Tuesday, August 13, 2019 6:01 AM
  • Why do you need to do that? You probably do not.

    If this thread did not help you then you should explain why here instead of creating List methods of a COM object from VB Script.

    Sam Hobbs

    Tuesday, August 13, 2019 11:51 PM
  • The Windows SDK has the OLE Object Viewer tool (oleview.exe). But the thing to remember is that any answer that we can give would be a very C++ oriented view. For example, using the OLE Object Viewer tool to look at what is exported by Microsoft Excel gives definitions along the lines of:

    interface IChartView : IDispatch {
        [propget, helpcontext(0x000be729)]
        HRESULT _stdcall Application([out, retval] Application** RHS);
        [propget, helpcontext(0x000be72a)]
        HRESULT _stdcall Creator([out, retval] XlCreator* RHS);
        [propget, helpcontext(0x000be72b)]
        HRESULT _stdcall Parent([out, retval] IDispatch** RHS);
        [propget, helpcontext(0x000beb11)]
        HRESULT _stdcall Sheet([out, retval] IDispatch** RHS);

    This may not be the way that it is exposed in other languages.

    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Wednesday, August 14, 2019 12:43 AM
  • As explained in the other thread, you should not need to do that.

    Sam Hobbs

    Wednesday, August 14, 2019 6:26 PM