Click here to Skip to main content
15,901,122 members
Home / Discussions / COM
   

COM

 
AnswerRe: I need some help about COM.. Pin
Roger Stoltz7-Feb-06 1:44
Roger Stoltz7-Feb-06 1:44 
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 
Hi,
I have two questions :
1) How would you create a singleton ATL COM Class? (Like when you do a CoCreateInstace for the interface, you always get the same instance of the class)
Right now I did a work around of declaring all the data as static variables.
I also read about a macro called as DECLARE_SOMETHING_SINGLETON (Not sure about the correct name)

2) I also have some global functions in the same COM Class. These global functions need to access the COM Class member functions. So the global functions need to access only the single instance of this COM Class at any cost. My COM Component is an Out-Proc Win NT Service.
The global function code looks like


CALLBACK Global_Fn()
{
//call the class's function
CCOMCLASSA *pA = NULL;
pA->MemberFunA(); //this is crap piece of code, but due to static vbles, it is working as of now
}


Any ideas to do all this elegantly? All help will be greatly appreciated.

Thanks
Misha



AnswerRe: Single Instance in COM Class Pin
Stephen Hewitt30-Jan-06 20:05
Stephen Hewitt30-Jan-06 20:05 
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 

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.