Click here to Skip to main content
15,922,427 members
Home / Discussions / COM
   

COM

 
QuestionHow to implement a schedule in VC++ Pin
Anonymous29-Nov-02 21:45
Anonymous29-Nov-02 21:45 
AnswerRe: How to implement a schedule in VC++ Pin
Jörgen Sigvardsson30-Nov-02 13:49
Jörgen Sigvardsson30-Nov-02 13:49 
GeneralLinking Pin
Anthony988728-Nov-02 11:04
Anthony988728-Nov-02 11:04 
GeneralDLL or COM component to attach template to word document Pin
Jude27-Nov-02 17:49
Jude27-Nov-02 17:49 
GeneralRegistering IE toolbar Pin
Dermidont27-Nov-02 11:51
Dermidont27-Nov-02 11:51 
GeneralRe: Registering IE toolbar Pin
xxhimanshu8-Dec-02 17:52
xxhimanshu8-Dec-02 17:52 
GeneralThreading Models and Monikers Pin
Heath Stewart27-Nov-02 2:20
protectorHeath Stewart27-Nov-02 2:20 
GeneralRe: Threading Models and Monikers Pin
Vi229-Nov-02 6:05
Vi229-Nov-02 6:05 
I think that the Threading Models and the Monikers are separate entities.

Threading Model is a type of apartment of COM object.
Moniker is a way to get a pointer to an object. Moniker as COM object has own Threading Model. Even it has own custom "by value" marshalling.

About BindToObject, look at MSDN "IMoniker—File Moniker Implementation".

As far as I know, pMoniker->BindToObject(pBindContext,NULL,riid,&pObj) will return the same object (i.e. singleton):

1) if pMoniker was created with the same lpszPathName and pBindContext is the same, i.e.
CreateFileMoniker(lpszPathName, &pMoniker1);
CreateFileMoniker(lpszPathName, &pMoniker2);
pMoniker1->BindToObject(pBindContext,NULL,riid,&pObj1);
pMoniker2->BindToObject(pBindContext,NULL,riid,&pObj2);
// here pObj1 == pObj2. It does not depend on type of object being bound.

2) if pMoniker was created with the same lpszPathName and object is registering itself or by moniker in ROT with the equal moniker, i.e.
pRunningObjectTable->Register(grfFlags,pObject,pFileMoniker,&dwRegister)
pBindContext has no meaning.

Simply speaking, moniker searches similar moniker in ROT or in a binding context. If no success, moniker will create new object.

Sorry, if I am not able to explain such complicated subject more cleanly.

With best wishes,
Vita
GeneralRe: Threading Models and Monikers Pin
Heath Stewart1-Dec-02 19:32
protectorHeath Stewart1-Dec-02 19:32 
QuestionWhy DllGetClassObject get the class factory instead of iunknown? Pin
doromoji25-Nov-02 20:47
sussdoromoji25-Nov-02 20:47 
AnswerRe: Why DllGetClassObject get the class factory instead of iunknown? Pin
Stephane Rodriguez.25-Nov-02 20:55
Stephane Rodriguez.25-Nov-02 20:55 
GeneralRe: Why DllGetClassObject get the class factory instead of iunknown? Pin
doromoji25-Nov-02 22:25
sussdoromoji25-Nov-02 22:25 
GeneralRe: Why DllGetClassObject get the class factory instead of iunknown? Pin
Stephane Rodriguez.25-Nov-02 22:34
Stephane Rodriguez.25-Nov-02 22:34 
GeneralRe: Why DllGetClassObject get the class factory instead of iunknown? Pin
Vi225-Nov-02 23:00
Vi225-Nov-02 23:00 
GeneralRe: Why DllGetClassObject get the class factory instead of iunknown? Pin
doromoji25-Nov-02 23:46
sussdoromoji25-Nov-02 23:46 
QuestionCan I write the an ODL script that can be compiled with MIDL Pin
SPGV24-Nov-02 21:48
SPGV24-Nov-02 21:48 
GeneralCOM Object Pin
Anthony988722-Nov-02 8:09
Anthony988722-Nov-02 8:09 
GeneralRe: COM Object Pin
geo_m29-Nov-02 22:30
geo_m29-Nov-02 22:30 
QuestionExcel grids? Pin
-Dy22-Nov-02 4:04
-Dy22-Nov-02 4:04 
AnswerRe: Excel grids? Pin
Steve S28-Nov-02 21:33
Steve S28-Nov-02 21:33 
QuestionOCX controls in a container - instantiation mechanism? Pin
Debs20-Nov-02 23:58
Debs20-Nov-02 23:58 
AnswerRe: OCX controls in a container - instantiation mechanism? Pin
Anonymous21-Nov-02 10:40
Anonymous21-Nov-02 10:40 
GeneralMS Project SDK Pin
Abubakar Siddque20-Nov-02 23:15
Abubakar Siddque20-Nov-02 23:15 
GeneralRe: MS Project SDK Pin
Christian Graus21-Nov-02 20:36
protectorChristian Graus21-Nov-02 20:36 
GeneralCalling Other DLLS from VC application Pin
Kashif Manzoor20-Nov-02 21:23
Kashif Manzoor20-Nov-02 21:23 

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.