Click here to Skip to main content
15,914,642 members
Home / Discussions / COM
   

COM

 
GeneralRe: Mixing COM event handling techniques Pin
zumichu21-Jul-04 19:44
zumichu21-Jul-04 19:44 
GeneralIHTMLWindow2 navigate opening new window Pin
zumichu20-Jul-04 11:11
zumichu20-Jul-04 11:11 
GeneralRe: IHTMLWindow2 navigate opening new window Pin
Alexander Wiseman20-Jul-04 11:40
Alexander Wiseman20-Jul-04 11:40 
GeneralRe: IHTMLWindow2 navigate opening new window Pin
zumichu20-Jul-04 12:50
zumichu20-Jul-04 12:50 
GeneralRe: IHTMLWindow2 navigate opening new window Pin
Alexander Wiseman20-Jul-04 14:25
Alexander Wiseman20-Jul-04 14:25 
GeneralRe: IHTMLWindow2 navigate opening new window Pin
zumichu20-Jul-04 16:22
zumichu20-Jul-04 16:22 
GeneralGUIDs and MIDL.exe Pin
Tropicana20-Jul-04 7:58
Tropicana20-Jul-04 7:58 
Questionhow to marshal interface Pin
yingkou19-Jul-04 18:30
yingkou19-Jul-04 18:30 
I want to use my interface pointer in new thread and this component is written by pure C++ not using ATL or MFC,my codes as below:

const CLSID clsid={0x7D519042,0x1645,0x4a8c,{0xBD,0xE0,0x0F,0x4A,0x44,0xFC,0x38,0xC4}};
const IID iid1={0x7D519040,0x1645,0x4a8c,{0xBD,0xE0,0x0F,0x4A,0x44,0xFC,0x38,0xC4}};

HRESULT hr=CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);
if(FAILED(hr))
{
MessageBox("CoInitialize Failed");
CoUninitialize();
return;
}
ISimpleInterface* ptr1=NULL;
hr=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,iid1,(void**)&ptr1);
if(FAILED(hr))
{
HLOCAL buf=NULL;
BOOL fOK=FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
|FORMAT_MESSAGE_ALLOCATE_BUFFER,0,hr,
MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),
(LPTSTR) &buf,0,0);
if(NULL!=buf)
{
MessageBox((LPCTSTR)LocalLock(buf));
LocalFree(buf);
}
return ;
}
hr=CoMarshalInterThreadInterfaceInStream(iid1,ptr1,&pStream);
if(S_OK != hr)
{
ptr1->Release();
HLOCAL buf=NULL;
BOOL fOK=FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|
FORMAT_MESSAGE_ALLOCATE_BUFFER,0,hr,
MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),
(LPTSTR)&buf,0,0);//Error:Interface not registered
if(NULL!=buf)
{
MessageBox((LPCTSTR)LocalLock(buf));
LocalFree(buf);
}
return ;
}
DWORD dwThreadId=0;
CreateThread(0,0,ThreadFun,0,0,&dwThreadId);
hr=ptr1->Sum();
if(FAILED(hr))
{
ptr1->Release();
MessageBox("DoSimpleMsgBox Failure");
return ;
}
ptr1->Release();
CoUninitialize();

How to modify that error,Using functiong of RpcServerRegisterIf2 to Register??? I don't know what to do next,please help me,thanks a lot
GeneralCreateObjrefMoniker - missing Pin
Sara Burns19-Jul-04 12:30
Sara Burns19-Jul-04 12:30 
GeneralAxWebBrowser.ExecWB printing error "Trying to revoke a drop target ..." Pin
alexatn16-Jul-04 12:14
alexatn16-Jul-04 12:14 
Generaldefaultvalue doesn't work with late-binding when using attributed objects Pin
Member 54073115-Jul-04 2:59
Member 54073115-Jul-04 2:59 
GeneralWord OLE temp document ~wroxxxx.doc Pin
vishalmore14-Jul-04 20:35
vishalmore14-Jul-04 20:35 
GeneralSuggestion for solved problems Pin
darkbyte14-Jul-04 14:04
darkbyte14-Jul-04 14:04 
QuestionHow to integrate out of process server with client Pin
piks14-Jul-04 0:50
piks14-Jul-04 0:50 
AnswerRe: How to integrate out of process server with client Pin
darkbyte14-Jul-04 13:55
darkbyte14-Jul-04 13:55 
Questionhow to use CoMarshalInterThreadInterfaceInStream? Pin
yingkou13-Jul-04 14:05
yingkou13-Jul-04 14:05 
GeneralActiveX and C# Pin
FlamTaps12-Jul-04 8:58
FlamTaps12-Jul-04 8:58 
QuestionCOM+ Task Scheduling? Pin
meierk12-Jul-04 6:00
meierk12-Jul-04 6:00 
AnswerRe: COM+ Task Scheduling? Pin
meierk12-Jul-04 7:41
meierk12-Jul-04 7:41 
GeneralBeginning COM programming Pin
Mekong River12-Jul-04 5:44
Mekong River12-Jul-04 5:44 
GeneralRe: Beginning COM programming Pin
SOCM_FP_CPP29-Jul-04 3:42
SOCM_FP_CPP29-Jul-04 3:42 
GeneralRe: Beginning COM programming Pin
Mekong River29-Jul-04 3:54
Mekong River29-Jul-04 3:54 
GeneralRe: Beginning COM programming Pin
yellowdragon29-Jul-04 3:49
yellowdragon29-Jul-04 3:49 
Questionhow to include a heading "help"? Pin
ffredoux12-Jul-04 3:44
ffredoux12-Jul-04 3:44 
GeneralIStream for files Pin
LasVegasGuy11-Jul-04 8:19
LasVegasGuy11-Jul-04 8:19 

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.