Why do I need to initialize MFC COM on some computers when calling COM components and some computers do not need ?

Category: VC/MFC -> ATL/ActiveX/COM Author: liang20071060153 Date: 2001-07-08 17:00:20
 
liang20071060153
2001-07-08 17:00:20
Are xp system , why mfc call com component when sometimes need to add AfxOleInit () sometimes do not need ?
losscat007
2001-07-08 17:05:12
because sometimes people call is :: CoInitialize (  NULL  ); /   :: CoUninitialize ();
sniperlk
2001-07-08 17:08:50
CoInitialize and OleInitialize a thread only called once.

AfxOleInit is the API package.

code elsewhere you may call this stuff .
birth19871230
2001-07-08 17:19:13

should be so
AfxOleInit is encapsulated
CoInitialize to do more things than CoInitialize
makeyulei
2001-07-08 17:24:26
This issue has puzzled me for a long time a
zjzjzjzjsj
2001-07-08 17:43:17
did not call , is the people have given you good work & middot;
golden_sky
2001-07-08 17:48:03
MFC has been initialized , and does not require you to re- initialize ,
not initialize another mfc using multi-threaded com
zhishicat
2001-07-08 18:05:06
need to initialize com environment
huang_yuhai
2001-07-08 18:17:44
when you do not need to have seen the situation
aygn1230
2001-07-08 18:34:30
is no need to call other code or MFC code   help you call the initialization
god301
2001-07-08 18:39:55


Thank you for your answer.

I have two computers in one stage is really no need to add AfxOleInit () this , and then the same code that I got when running on another machine , you need to add , are the xp system is mfc program .

I 've ever seen. . .
lczq02
2001-07-08 18:46:15


amount , first of all, if I saw your earlier answer , I would be less tangled a lot , your answer is correct , but sometimes AfxOleInit () will take to the question :

I AfxOleInit () to initialize the com , my program one will collapse, I declare : I am not a problem of the program ( or maybe yes, but after I carefully considered seriously debugging , I'm sure the problem is not my program ) , when I do not add AfxOleInit another machine on my ( ) to run my program, there is no problem , so I put the blame and AfxOleInit (), and then I start the Internet to find the replacement AfxOleInit () function , then it is to use this function you say to replace AfxOleInit (), my program healthier ! ! !

to share with you , if you find AfxOleInit () to initialize when there is a problem , you can try :: CoInitialize (  NULL  ); As to why this is so ? I also think this is a good question, but I do not know, so I also wanted to ask why this is so ? ? ? ?
princehq
2001-07-08 18:49:32


I put Microsoft somehow those errors are due to Microsoft's aunt came. . .