Click here to Skip to main content
15,908,112 members
Home / Discussions / COM
   

COM

 
GeneralRe: ITypelib2::GetDocumentation2 Pin
6-Feb-01 15:19
suss6-Feb-01 15:19 
GeneralDcom working on the client(suppose to work work on the server) Pin
Hushpappy3-Jan-01 6:22
Hushpappy3-Jan-01 6:22 
GeneralRe: Dcom working on the client(suppose to work work on the server) Pin
18-Jan-01 14:15
suss18-Jan-01 14:15 
GeneralRe: Dcom working on the client(suppose to work work on the server) Pin
John McTainsh4-Feb-01 16:22
John McTainsh4-Feb-01 16:22 
QuestionQ: how to expose an interface using ATL? Pin
Tony Young27-Dec-00 10:08
Tony Young27-Dec-00 10:08 
AnswerRe: Q: how to expose an interface using ATL? Pin
Michael Dunn27-Dec-00 14:21
sitebuilderMichael Dunn27-Dec-00 14:21 
GeneralAsp and thumbnail Pin
26-Dec-00 2:35
suss26-Dec-00 2:35 
GeneralMixed COM Apartment models Pin
Christian Skovdal Andersen22-Dec-00 11:39
Christian Skovdal Andersen22-Dec-00 11:39 
Hi,

I have the following problem.

From within the same thread I wish to call two components with different threading models.

Number one component will instantiate another component and receive events through connection points. This component will have to be Free-threaded or the call to ICOnnectionPoint::Advise() will fail.

The other component should instantiate the IShellLink interface to create a shortcut.


Take a look at this sample:

    // COINIT_MULTITHREADED is neccesary because one component is free-threaded
::CoInitializeEx(NULL, COINIT_MULTITHREADED);

HRESULT hr = S_OK;
IMulti* p1 = NULL;

IShellLink *psl=NULL;
hr = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*) &psl);
ASSERT(SUCCEEDED(hr));

hr = CoCreateInstance(CLSID_Multi, NULL, CLSCTX_INPROC_SERVER, __uuidof(IMulti), (void**)&p1);
ASSERT(SUCCEEDED(hr));

p1->Release();
psl->Release();

::CoUninitialize();


The problem is that the call to
hr = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*) &psl)
fails when CoInitializeEx has been called with the COINIT_MULTITHREADED parameter

Any help will be greatly appreciated

Christian Skovdal Andersen
GeneralClistCtrl and Callback Items in WTL Pin
21-Dec-00 22:40
suss21-Dec-00 22:40 
GeneralATL component connection points and smart pointers error Pin
19-Dec-00 7:40
suss19-Dec-00 7:40 
GeneralRe: ATL component connection points and smart pointers error Pin
Brian C Hart19-Dec-00 10:01
professionalBrian C Hart19-Dec-00 10:01 
GeneralRe: ATL component connection points and smart pointers error Pin
20-Dec-00 5:04
suss20-Dec-00 5:04 
GeneralClass not registered Pin
VVN18-Dec-00 5:42
VVN18-Dec-00 5:42 
GeneralRe: Class not registered Pin
18-Dec-00 9:14
suss18-Dec-00 9:14 
GeneralRe: Class not registered Pin
18-Dec-00 9:15
suss18-Dec-00 9:15 
GeneralRe: Class not registered Pin
Julien16-Jan-01 11:20
Julien16-Jan-01 11:20 
GeneralWindow DLL to detect wm_message of an active window Pin
16-Dec-00 22:33
suss16-Dec-00 22:33 
QuestionCOM can be used instead of Dlls ? Pin
11-Dec-00 3:31
suss11-Dec-00 3:31 
QuestionRegistering COM Object (NT Service) on Remote mahine? Pin
Ahmed01927-Dec-00 21:16
Ahmed01927-Dec-00 21:16 
QuestionMy ActiveX in Excel's "Insert object" dialog? Pin
Serge_l5-Dec-00 21:31
Serge_l5-Dec-00 21:31 
GeneralDynamic Search Handlers Pin
Jason De Arte27-Nov-00 10:08
Jason De Arte27-Nov-00 10:08 
GeneralActiveX Documents [Container] - Flash control transparency Pin
Jeetendra Dhall26-Nov-00 20:27
Jeetendra Dhall26-Nov-00 20:27 
GeneralShellExtension & PropertyPage & WTL Pin
Mody_CZ19-Nov-00 21:35
Mody_CZ19-Nov-00 21:35 
GeneralCOM & Callbacks Pin
Brian van der Beek11-Nov-00 22:58
Brian van der Beek11-Nov-00 22:58 
GeneralMicrosoft G.723.1 codec Pin
Oleg M9-Nov-00 2:43
sussOleg M9-Nov-00 2:43 

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.