473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 1857
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gary | last post by:
sorry for not cross-posting originally (originally posted in the components subgroup) I seem to have run into two documented bugs whose workarounds are incompatible. What I have is an OCX...
30
by: Joost Ronkes Agerbeek | last post by:
Why is it allowed in C++ to call a static member function of an object through an instance of that object? Is it just convenience? tia, Joost Ronkes Agerbeek
5
by: Francesco Bochicchio | last post by:
Hi all, anybody knows if there is a (standard, portable) way to dinamically build a list of parameters to call a C function? Something like va_start & co, but to be used on the calling side? ...
19
by: Deniz Bahar | last post by:
Hi, I would like to call one of my functions the exact name as an existing C library function (for example K&R2 exercises asks me to make an atof function). If I don't include the header with...
21
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered...
3
by: phl | last post by:
hi, I have a number of usercontrols which inherits a interface. the function in this interface is used to provide information about the usercontrol. I would like to call this function say when a...
3
by: Ray Cassick \(Home\) | last post by:
I have several classes that has a public interface (nothing really different there :) ). 1) I would like to ensure that some classes can only be instantiated by a specific class type. 2) ...
3
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb)....
6
by: Lak | last post by:
Hi all I am trying to call a C# method (in a DLL) asynchronously from VB. I don't know how to do this. Any suggestion is appreciated. Thanks.
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.