c# - Accessing class from COM Object -
i have written class library (.dll) in c#, called 3rd-party .exe. .exe calls method in .dll, passing com object method. various reasons, don't have access equivalent class definition of com object, able discover public methods , properties, using handy dispatchutility
class tool. hoped create extern class
definition, can access members, discovered, c# not allow that.
what best/"proper" way access these class members?
if know method names , argument types, can use dynamic
.
dynamic o = thecomobject; o.somemethod(arg1, arg2, arg3); var v = o.someproperty;
Comments
Post a Comment