Calling COM DLL interface function at run-time

  • Thread starter Thread starter Meya-awe
  • Start date Start date
M

Meya-awe

I am using C++ unmanaged code, given a string to function name, i need
to be able to call the DLLs COM interface with the same name. How can i
do this in C++ unmanaged code?
thanks,
BRAMOIN
 
Hi,

In order to call COM interface's method you need to go through the
following steps:

1. Create COM object
2. Query for the IDispatch interface
3. Call the IDispatch::Invoke method passing as one of the arguments
the name of the method you want to execute

Everything is simple enough if the method do not have arguments.
However, if it has arguemts then the steps are the same but it may take
you a while to compose arguments for IDispatch::Invoke method.

Regards,
Philip
 
Philip,
What do you mean it may take me a while to compile the arguments? Is
there a method to this or something i need to know? Is there an example
you could point me to?
thanks,
BRAMOIN
 
Meya-awe said:
Philip,
What do you mean it may take me a while to compile the arguments? Is
there a method to this or something i need to know? Is there an example
you could point me to?
thanks,
BRAMOIN

You might get better answers when post your C++ question to
microsoft.public.dotnet.languages.vc, this NG is for CSharp.

Willy.
 
I am using C++. I receive invoke the IDispatch invoke and it comes back
with "Exception occured". How do i look to see what the exception was
from and what the problem is exactly?
thanks,
BRAMOIN
 
Back
Top