How can would you create an instance of the object in COM

Answers were Sorted based on User's Feedback



How can would you create an instance of the object in COM..

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

How can would you create an instance of the object in COM..

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

Post New Answer

More COM DCOM Interview Questions

How do we create dcom object in vb6?

0 Answers  


Which namespace do the classes, allowing you to support COM functionality, are located?

0 Answers  


What are the different compatibility types when we create a COM component?

1 Answers   TCS,


what is oops

11 Answers   Accenture,


What is the difference between aggregated and contained objects?

0 Answers  






What is In-proc?

4 Answers  


what is far pointer and what are the use of far poiter in com/dcom ?????

2 Answers   HCL,


Write a JCL to copy only selected members from a partitioned data set to another partitioned data set. (Use: IEBCOPY)

1 Answers   Wipro,


Can you explain what is dcom?

0 Answers  


Define and explain COM?

8 Answers   Microsoft,


Is dcom dead?

0 Answers  


Can I use .net components from com programs?

0 Answers  


Categories