Click here to Skip to main content
15,905,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Property Sheet Problem Pin
si_6922-Apr-06 11:58
si_6922-Apr-06 11:58 
Questionhow can i get my app path? Pin
Sina Parastgary21-Apr-06 23:29
Sina Parastgary21-Apr-06 23:29 
AnswerRe: how can i get my app path? Pin
Naveen21-Apr-06 23:40
Naveen21-Apr-06 23:40 
AnswerRe: how can i get my app path? Pin
Michael Dunn22-Apr-06 9:14
sitebuilderMichael Dunn22-Apr-06 9:14 
QuestionUsing OLE IStream in a thread Pin
Waldermort21-Apr-06 23:27
Waldermort21-Apr-06 23:27 
AnswerRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 0:32
Stephen Hewitt22-Apr-06 0:32 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 0:46
Waldermort22-Apr-06 0:46 
GeneralRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 1:08
Stephen Hewitt22-Apr-06 1:08 
Here's one way to do it:
------------------------
IStream *pMarshalData;
HRESULT hr = CoMarshalInterThreadInterfaceInStream(IID_IStream, pStream, &pMarshalData);
if ( SUCCEEDED(hr) )
{
// Spawn your new thread here. Pass it the pMarshalData pointer.
}

// In the spawned thread somewhere.
IStream *pStream;
HRESULT hr = CoGetInterfaceAndReleaseStream(pMarshalData, IID_IStream, reinterpret_cast<void**>(&pStream));
if ( SUCCEDED(hr) )
{
// Use pStream.
pStream->Release();
}
------------------------

The astute reader may notice that we're using "pMarshalData" in another thread without marshalling. This is OK as the object returned by this API is free threaded.


Steve
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 1:58
Waldermort22-Apr-06 1:58 
GeneralRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 2:01
Stephen Hewitt22-Apr-06 2:01 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 2:14
Waldermort22-Apr-06 2:14 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 2:41
Waldermort22-Apr-06 2:41 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 3:36
Waldermort22-Apr-06 3:36 
GeneralRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 3:51
Stephen Hewitt22-Apr-06 3:51 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 4:08
Waldermort22-Apr-06 4:08 
GeneralRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 4:26
Stephen Hewitt22-Apr-06 4:26 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 4:42
Waldermort22-Apr-06 4:42 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 6:23
Waldermort22-Apr-06 6:23 
GeneralRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 1:19
Stephen Hewitt22-Apr-06 1:19 
QuestionWhy can't debug in multy top document program(vs2003)? Pin
zhoucheng21-Apr-06 23:13
zhoucheng21-Apr-06 23:13 
QuestionSuggestions for Code Obfuscator and/or Encrypter Pin
JSadleir21-Apr-06 22:18
JSadleir21-Apr-06 22:18 
AnswerRe: Suggestions for Code Obfuscator and/or Encrypter Pin
Nick_Kisialiou22-Apr-06 0:53
Nick_Kisialiou22-Apr-06 0:53 
AnswerRe: Suggestions for Code Obfuscator and/or Encrypter Pin
Roland Pibinger22-Apr-06 1:04
Roland Pibinger22-Apr-06 1:04 
GeneralRe: Suggestions for Code Obfuscator and/or Encrypter Pin
JSadleir22-Apr-06 14:09
JSadleir22-Apr-06 14:09 
AnswerRe: Suggestions for Code Obfuscator and/or Encrypter Pin
John R. Shaw22-Apr-06 19:14
John R. Shaw22-Apr-06 19:14 

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.