When we aggregate an object is it possible to expose only certain interfaces(as opposed to all interfaces) of the inner component? Consider this scenario:
The inner component has interfaces I1 and I2. The outer component wants to expose only I1(in addition to its own interfaces). But once I...
I tried the following code and it worked. All I did is to add a DEF file to the dll project.
***************************************************************
// DLL part
void __declspec(dllexport)__stdcall doIt()
{
AfxMessageBox("doIt");
}...
If we passed only the pointer we can't change the value of thepointer(we can only change the contents pointed to by the pointer). So we pass the address of the (interface) pointer. so we need another level of indirection. CoCreateInstance() takes a void** parameter. So we need to type cast the...
You can refer
Chapter Two: IUnknown and IClassFactory
in
"Inside Distributed COM" by Guy Eddon and Henry Eddon Microsoft Press.
There is a complete listing for a simple self-registering COM Component there.
-S.Kannan
There are a few situations where it is necessary to use new.
For e.g.,
suppose we create a linked list with the following node structure.
struct node{
int data;
node* next;
};
If you are create the linked list in one function(where you will assign value to next) and use the linked...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.