Click here to Skip to main content
15,900,725 members
Home / Discussions / COM
   

COM

 
GeneralRe: No, that sucked Pin
geo_m30-Dec-03 0:32
geo_m30-Dec-03 0:32 
GeneralAll COM that expose a specific interface Pin
IreneVassileva22-Dec-03 0:00
IreneVassileva22-Dec-03 0:00 
GeneralRe: All COM that expose a specific interface Pin
Abhishek Srivastava22-Dec-03 1:01
Abhishek Srivastava22-Dec-03 1:01 
GeneralYahoo messenger login interface. Urgent Pin
SiddharthAtw21-Dec-03 18:35
SiddharthAtw21-Dec-03 18:35 
QuestionHow to access COM objects during runtime? Pin
dapipi21-Dec-03 17:13
dapipi21-Dec-03 17:13 
AnswerRe: How to access COM objects during runtime? Pin
Anonymous21-Dec-03 18:47
Anonymous21-Dec-03 18:47 
AnswerRe: How to access COM objects during runtime? Pin
Anonymous21-Dec-03 18:52
Anonymous21-Dec-03 18:52 
AnswerRe: How to access COM objects during runtime? Pin
Abhishek Srivastava21-Dec-03 19:07
Abhishek Srivastava21-Dec-03 19:07 
Hi there, Smile | :)

One can access COM objects at run time , but the interface supported by this COM object should
support IDispatch interface.

CLSID objClsid;
// initialize your obj CLSID in this variable


using CoCreateInstance() get the IDispatch pointer.

IDispatch *dispPtr;
CoCreateInstance(objClsid, NULL, CLSCTX_ALL, IID_IDispatch , (void **) &dispPtr);

if your object support IDispatch interface , it will return its instance , else it will return NULL.
now using this dispPtr and IDispatch

int isInfoAvailable;
dispPtr->GetTypeInfoCount(&isInfoAvailable);

if isInfoAvailable = 0 , that means this object does not provide run time type information of interfaces it supports.

if isInfoAvailable = 1 , that mean now you can query for ITypeInfo interface pointer for getting information about the interface this object supports.

now using GetTypeInfo() method you can further query for ITypeInfo interface , using which you can browse all the interface and methods of these interface supported by your COM object.

and then using Invoke and GetIDsOfName methods of IDispatch you can also execute your method at run time.

Regards





Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921 Smile | :)

GeneralRe: How to access COM objects during runtime? Pin
dapipi22-Dec-03 19:30
dapipi22-Dec-03 19:30 
GeneralLookgin for good COM+ book suggestions Pin
Flack21-Dec-03 14:16
Flack21-Dec-03 14:16 
GeneralIRunnableTask and IExtractImage Pin
ohadp18-Dec-03 1:45
ohadp18-Dec-03 1:45 
GeneralHelp me for COM+ design with C#.NET Pin
Simi Agarwal17-Dec-03 21:37
Simi Agarwal17-Dec-03 21:37 
QuestionHow to capture mouse event in MS word? Pin
aw1ay17-Dec-03 15:55
aw1ay17-Dec-03 15:55 
GeneralMS Active Accessibility problem Pin
visharma17-Dec-03 10:52
visharma17-Dec-03 10:52 
GeneralCreating WorksheetFunctions for Excel Office XP Pin
ThOmAs2217-Dec-03 8:23
ThOmAs2217-Dec-03 8:23 
GeneralAccess IDispatch from C Pin
Spiros17-Dec-03 2:45
Spiros17-Dec-03 2:45 
GeneralRe: Access IDispatch from C Pin
Jörgen Sigvardsson22-Dec-03 14:08
Jörgen Sigvardsson22-Dec-03 14:08 
GeneralUsing Recordset in .NET created by COM object Pin
rivimey17-Dec-03 1:48
rivimey17-Dec-03 1:48 
Questionany body knowing menu merging? Pin
safee ullah15-Dec-03 19:43
safee ullah15-Dec-03 19:43 
Generalverbs and shared menus in Active x Control Pin
safee ullah15-Dec-03 19:24
safee ullah15-Dec-03 19:24 
General.Net control in ActiveX host, accelerators/tabbing not working Pin
thedex15-Dec-03 3:17
thedex15-Dec-03 3:17 
GeneralOutlook Events Pin
derzellner15-Dec-03 0:08
derzellner15-Dec-03 0:08 
Generalcannot register automatic a COM into Components Services Pin
alinilie14-Dec-03 10:54
alinilie14-Dec-03 10:54 
GeneralSending Events from a DLL Pin
Sid_smily12-Dec-03 7:21
Sid_smily12-Dec-03 7:21 
GeneralRe: Sending Events from a DLL Pin
Abhishek Srivastava12-Dec-03 22:21
Abhishek Srivastava12-Dec-03 22:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.