Click here to Skip to main content
15,915,019 members
Home / Discussions / COM
   

COM

 
GeneralRe: I need some help about COM.. Pin
Jörgen Sigvardsson7-Feb-06 11:38
Jörgen Sigvardsson7-Feb-06 11:38 
AnswerRe: I need some help about COM.. Pin
Malli_S14-Feb-06 18:13
Malli_S14-Feb-06 18:13 
QuestionInk with inkobj.dll and classic ASP Pin
realmontanakid2-Feb-06 23:23
realmontanakid2-Feb-06 23:23 
QuestionSolidus Pin
LiquidSilk1-Feb-06 7:00
LiquidSilk1-Feb-06 7:00 
Questionrelated to thunderbird extension Pin
baldha rakesh31-Jan-06 18:52
baldha rakesh31-Jan-06 18:52 
QuestionTroubleshooting System.Runtime.InteropServices.COMException Pin
mysorian31-Jan-06 5:15
professionalmysorian31-Jan-06 5:15 
QuestionSingle Instance in COM Class Pin
misha_grewal30-Jan-06 19:38
misha_grewal30-Jan-06 19:38 
AnswerRe: Single Instance in COM Class Pin
Stephen Hewitt30-Jan-06 20:05
Stephen Hewitt30-Jan-06 20:05 
1. You're thinking of the DECLARE_CLASSFACTORY_SINGLETON macro. You'd use it like this:
class ATL_NO_VTABLE CYourClass : 
     public CComObjectRootEx<CComSingleThreadModel>,
     public CComCoClass<Csadfas, &CLSID_sadfas>,
     public IDispatchImpl<Isadfas, &IID_IBlah, &LIBID_ATLPROJLib>
{
     // .
     // Blah blah
     // .
 
     DECLARE_CLASSFACTORY_SINGLETON(CYourClass)
 
     // .
     // Blah blah
     // .
 


2. Given that the class factories have been registered (it's an .EXE server) using the CoRegisterClassObject API you can safely and efficiently implement your globals like this:
void MyGlobal()
{
     CComPtr<IMyInterface> spInt;
     if ( SUCCEEDED(spInt.CoCreateInstance(CLSID_YourCLSID)) )
     {
         spInt->YourMethod();
     }
}


Steve
GeneralRe: Single Instance in COM Class Pin
misha_grewal30-Jan-06 21:53
misha_grewal30-Jan-06 21:53 
GeneralRe: Single Instance in COM Class Pin
misha_grewal31-Jan-06 1:19
misha_grewal31-Jan-06 1:19 
GeneralRe: Single Instance in COM Class Pin
Stephen Hewitt31-Jan-06 11:42
Stephen Hewitt31-Jan-06 11:42 
GeneralRe: Single Instance in COM Class Pin
Gizzo31-Jan-06 23:38
Gizzo31-Jan-06 23:38 
GeneralRe: Single Instance in COM Class Pin
Stephen Hewitt1-Feb-06 0:45
Stephen Hewitt1-Feb-06 0:45 
GeneralRe: Single Instance in COM Class Pin
subzero_strike4-Feb-10 0:39
subzero_strike4-Feb-10 0:39 
GeneralRe: Single Instance in COM Class Pin
Stephen Hewitt4-Feb-10 21:39
Stephen Hewitt4-Feb-10 21:39 
QuestionDrag n Drop Pin
Anil_vvs30-Jan-06 17:51
Anil_vvs30-Jan-06 17:51 
QuestionUsing COM library in a managed code without registration Pin
Alexander Kleshchevnikov29-Jan-06 13:11
Alexander Kleshchevnikov29-Jan-06 13:11 
QuestionAdding a new ColePropertyPage to a MFC ActiveX Pin
godspeed12328-Jan-06 6:02
godspeed12328-Jan-06 6:02 
QuestionCOM specification Pin
QuickDeveloper26-Jan-06 17:17
QuickDeveloper26-Jan-06 17:17 
AnswerRe: COM specification Pin
Gizzo26-Jan-06 21:30
Gizzo26-Jan-06 21:30 
QuestionHow to Pass c++ object across ATL DLL Pin
annjose2425-Jan-06 2:37
annjose2425-Jan-06 2:37 
AnswerRe: How to Pass c++ object across ATL DLL Pin
Stephen Hewitt25-Jan-06 22:23
Stephen Hewitt25-Jan-06 22:23 
GeneralRe: How to Pass c++ object across ATL DLL Pin
annjose2426-Jan-06 16:33
annjose2426-Jan-06 16:33 
GeneralRe: How to Pass c++ object across ATL DLL Pin
Stephen Hewitt26-Jan-06 16:56
Stephen Hewitt26-Jan-06 16:56 
GeneralRe: How to Pass c++ object across ATL DLL Pin
annjose2426-Jan-06 17:07
annjose2426-Jan-06 17:07 

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.