471,321 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

Calling COM DLL interface function at run-time

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

*** Sent via Developersdex http://www.developersdex.com ***

Nov 29 '05 #1
4 1782
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

-------------------------------------
BytesRoad.NetSuit - open source network library for .NET platform (C#,
FTP, Socks5 etc)
http://www.bytesroad.com
-------------------------------------

Nov 29 '05 #2
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

*** Sent via Developersdex http://www.developersdex.com ***
Nov 29 '05 #3

"Meya-awe" <br*****@yahoo.com> wrote in message
news:u4*************@TK2MSFTNGP15.phx.gbl...
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

*** Sent via Developersdex http://www.developersdex.com ***


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

Willy.

Nov 29 '05 #4
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

*** Sent via Developersdex http://www.developersdex.com ***
Dec 6 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

30 posts views Thread by Joost Ronkes Agerbeek | last post: by
5 posts views Thread by Francesco Bochicchio | last post: by
19 posts views Thread by Deniz Bahar | last post: by
21 posts views Thread by Helge Jensen | last post: by
3 posts views Thread by Ray Cassick \(Home\) | last post: by
3 posts views Thread by Jerome Cohen | last post: by
7 posts views Thread by =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.