Calling COM DLL interface function at run-time

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
 
P

Philip

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
 
M

Meya-awe

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
 
W

Willy Denoyette [MVP]

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.
 
M

Meya-awe

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top