C++ static binding
C++ world depends on member functions to interface with external world. C++ compiler creates a compiler table to lookup the function needed for a class. This type of binding is called compile time binding or static binding. This is good when program is compiled along with static or dynamic library.
C++ dynamic binding
COM/DCOM C, C++ and C# language use vtable addresses to call COM/DCOM functions. Additional COM functions are placed after IUnknown vtable entries. Each function takes size of pointer and function can be called adding the offset in the vtable. This is the mechanism of C++ compiler to support inheritance and pure virtual functions.
DCOM ID binding
Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs, which can be used on subsequent calls to IDispatch::Invoke.
HRESULT GetIDsOfNames( REFIID riid, OLECHAR FAR* FAR* rgszNames, unsigned int cNames, LCID lcid, DISPID FAR* rgDispId );
- riid - Reserved and must be IID_NULL.
- rgszNames - Passed-in array of names to be mapped.
- cNames - Count of the names to be mapped. Count of items in rgszNames array.
- lcid - The locale context in which to interpret the names.
- rgDispId - Caller-allocated array, each element of which contains an identifier (ID) corresponding to one of the names passed in the rgszNames array. The first element represents the member name. The subsequent elements represent each of the member's parameters.
The return value obtained from the returned HRESULT is one of the following:
- S_OK - Success.
- E_OUTOFMEMORY - Out of memory.
- DISP_E_UNKNOWNNAME One or more of the names were not known. The returned array of DISPIDs contains DISPID_UNKNOWN for each entry that corresponds to an unknown name.
- DISP_E_UNKNOWNLCID The locale identifier (LCID) was not recognized.
DISP IDs in IWebBrowser
This is the IDL definition of IWebBrowser in EXDISP.IDL. It shows DISP IDs of GoBack, GoForward,GoHome,GoSearch,Navigate methods and DISP ID of the property Visible.
IWebBrowser DISP id demo
Below example code is a demo of GetIDsOfNames() call. It takes few method names of IWebBrowser and returns the DISP IDs of each methods.
IWebBrowser DISP id output
GetIDsOfNames demo with IWebBrowser interface GoBack => id(100) GoForward => id(101) GoHome => id(102) GoSearch => id(103) Navigate => id(104) Visible => id(402) Press any key to continue
About our authors: Team EQA
You have viewed 1 page out of 67. Your COM/DCOM learning is 0.00% complete. Login to check your learning progress.
Questions index C Questions C++ Questions Win32 MFC COM/DCOM DLL Questions
Compilers & Editors
Download Visual Studio Download XCode Download Visual Studio Code Android studio install sdk Eclipse installer Best C compilers IDEs
Development system setup
Windows media creation tool MSDN subscription Ubuntu virtualbox
New updated posts
Why learn C? Draw on printer Memory leaks Best Hosting plans, 80% discounts