Click here to Skip to main content
15,920,030 members
Home / Discussions / COM
   

COM

 
GeneralIContextMenu copy in app to Explorer Pin
Null_Vector7-Aug-02 14:26
Null_Vector7-Aug-02 14:26 
GeneralRe: IContextMenu copy in app to Explorer Pin
Null_Vector9-Aug-02 0:24
Null_Vector9-Aug-02 0:24 
Generalneed help for CoInitializeEx(..) Pin
Jawid7-Aug-02 5:23
Jawid7-Aug-02 5:23 
GeneralRe: need help for CoInitializeEx(..) Pin
Mark Janveaux7-Aug-02 13:03
Mark Janveaux7-Aug-02 13:03 
GeneralPassing an interface through an ATL interface Pin
HawkSoftware6-Aug-02 10:36
HawkSoftware6-Aug-02 10:36 
GeneralRe: Passing an interface through an ATL interface Pin
Mark Janveaux6-Aug-02 13:01
Mark Janveaux6-Aug-02 13:01 
GeneralRe: Passing an interface through an ATL interface Pin
HawkSoftware6-Aug-02 15:46
HawkSoftware6-Aug-02 15:46 
GeneralRe: Passing an interface through an ATL interface Pin
Mark Janveaux6-Aug-02 17:45
Mark Janveaux6-Aug-02 17:45 
You do not need to rerun the class wizard to change the threading model from apartment to free threaded. I believe you can find this under registry resource for your project (just change where it says 'apartment' or 'both' to 'free'), after you make the change be sure to re-register the interface. As far as creating a singleton object is concerned, there is an ATL macro 'DECLARE_CLASSFACTORY_SINGLETON' which should do the trick for you, the macro basically specifies that the class CComClassFactorySingleton will be the object which is queried upon every call to CreateInstance allowing a single instance to be passed for each call.

The only caveat is that you must make sure that the CurrentStateInterface is thread safe. This means protecting access to any shared objects or data (by shared, I mean objects that may be modified across threads). If everything is strictly read only, I don't think you have anything to worry about, but if you are modifying data, you must make sure you wrap these parts of the program in critical sections to correctly synchronize access these to objects.

Unfortunately, I don't have any code which I am able to share with you implementing singleton objects. There should be many examples however in MSDN. Do a search on the DECLARE_CLASSFACTORY_SINGLETON macro and see what you come up with.

Cheers!


GeneralAdding MFC to existing COM Server DLL Pin
b_p_smith6-Aug-02 4:23
b_p_smith6-Aug-02 4:23 
GeneralRe: Adding MFC to existing COM Server DLL Pin
Anonymous7-Aug-02 23:59
Anonymous7-Aug-02 23:59 
GeneralRe: Adding MFC to existing COM Server DLL Pin
b_p_smith8-Aug-02 3:30
b_p_smith8-Aug-02 3:30 
GeneralRe: Adding MFC to existing COM Server DLL Pin
Vi29-Aug-02 1:36
Vi29-Aug-02 1:36 
GeneralReturning a dispinterface from VC to VB Pin
Jon Taylor5-Aug-02 11:06
Jon Taylor5-Aug-02 11:06 
GeneralRe: Returning a dispinterface from VC to VB Pin
Vi26-Aug-02 2:14
Vi26-Aug-02 2:14 
Generalhelp needed...!!! Pin
drmzunlimited5-Aug-02 7:43
drmzunlimited5-Aug-02 7:43 
QuestionConnect to external InProc Server ? Pin
Mark Janveaux4-Aug-02 20:45
Mark Janveaux4-Aug-02 20:45 
AnswerRe: Connect to external InProc Server ? Pin
Jawid7-Aug-02 5:32
Jawid7-Aug-02 5:32 
AnswerRe: Another way - ROT Pin
Vi27-Aug-02 6:04
Vi27-Aug-02 6:04 
GeneralReceive events in vb from an interface returned by a method Pin
farrukh khalil4-Aug-02 19:19
sussfarrukh khalil4-Aug-02 19:19 
GeneralRe: Receive events in vb from an interface returned by a method Pin
Vi24-Aug-02 20:16
Vi24-Aug-02 20:16 
GeneralComAddin and addin Pin
Gheyret4-Aug-02 18:53
Gheyret4-Aug-02 18:53 
QuestionATL Problems?? Pin
Leesen3-Aug-02 22:56
Leesen3-Aug-02 22:56 
AnswerRe: ATL Problems?? Pin
Vi24-Aug-02 20:12
Vi24-Aug-02 20:12 
QuestionHow to get CLSID for the underlying object. Pin
cagey2-Aug-02 10:04
cagey2-Aug-02 10:04 
AnswerRe: How to get CLSID for the underlying object. Pin
soptest2-Aug-02 13:17
soptest2-Aug-02 13:17 

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.