Re: Checking the existence of a method in an Interface
"gshetty" <gshetty85@gmail.com> wrote in message
news:b024fbb7-1a4a-445c-8521-cf65f72f7855@p25g2000pri.googlegroups.com
Is it possible to verify whether a method exists in a interface before
calling it? I call a method within an interface in a third party COM
Dll. But my application crashes when it is run with an older version
of the same Dll that does not contain the specific method within that
Interface..
It appears that your DLL violates one of the fundamental principles of
COM: the interface is immutable once publicly released. If you want to
add methods to it (or remove, or change signature of existing methods),
you must define a new interface with a new IID.
To answer your question - no, I don't know of any way to do this. Which
is precisely why the immutability rule is in place.
As a workaround, perhaps you can check the version number of the
installed DLL. Or redistribute an updated version with your application.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925