How can would you create an instance of the object in COM
Answers were Sorted based on User's Feedback
Answer / chandrasekharreddy siddamreddy
To create the instance of COM componet use the following
WIN32 APIs
To access the component that was there in local system use
following API
CoCreateInstance(clsid,NULL(used for
aggregation),CLSCTX_ALL,Interface_GUID,(void**)
&pRequestedInterface );
To access the COM componet remotely use the following API
CoCreateInstanceEx
(CLSID,NULL,CLSCTX_ALL,COSERVERINFO,Interface_GUID,MULTI_QI*
);
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / balaji
We can use CreateInstance And CoCreateInstance to create an
instance of the object in COM.
HRESULT CreateInstance(void* pfnCreateInstance,REFIID riid,
void** ppvObj );
Parameters
pfnCreateInstance
[in] A pointer to a creator function.
riid
[in] The IID of the requested interface.
ppvObj
[out] A pointer to the interface pointer identified by
riid. If the object does not support this interface, ppvObj
is set to NULL.
Return Value
| Is This Answer Correct ? | 2 Yes | 1 No |
Can I use .net components from com programs?
Suppose we have object b and aggregated object c (in- proc server), created by b. Can you access any interface of b from c? What?s the difference between aggregated and contained objects?
Define and explain about COM?
C is aggregated by B, which in turn aggregated by A. Our client requested C. What will happen?
Explain object pooling?
What are the different compatibility types when we create a COM component?
What are queued components?
How do we create dcom object in vb6?
Can I use com components from .net programs?
Explain Futures of COM?
how you call a dll as a COM dll.
What is the difference, if any, between OLE and COM?