Click here to Skip to main content
15,922,574 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionreading strings from file - newbie Pin
antonaras_marcou22-Apr-06 1:23
antonaras_marcou22-Apr-06 1:23 
AnswerRe: reading strings from file - newbie Pin
Stephen Hewitt22-Apr-06 1:46
Stephen Hewitt22-Apr-06 1:46 
GeneralRe: reading strings from file - newbie Pin
antonaras_marcou22-Apr-06 2:07
antonaras_marcou22-Apr-06 2:07 
GeneralRe: reading strings from file - newbie Pin
Stephen Hewitt22-Apr-06 2:10
Stephen Hewitt22-Apr-06 2:10 
AnswerRe: reading strings from file - newbie Pin
Michael Dunn22-Apr-06 9:12
sitebuilderMichael Dunn22-Apr-06 9:12 
GeneralRe: reading strings from file - newbie Pin
Stephen Hewitt22-Apr-06 18:51
Stephen Hewitt22-Apr-06 18:51 
QuestionPlacing transparent bitmaps into dialogs Pin
Rafael Fernández López22-Apr-06 1:04
Rafael Fernández López22-Apr-06 1:04 
AnswerRe: Placing transparent bitmaps into dialogs Pin
John R. Shaw22-Apr-06 18:37
John R. Shaw22-Apr-06 18:37 
QuestionProperty Sheet Problem Pin
si_6921-Apr-06 23:42
si_6921-Apr-06 23:42 
AnswerRe: Property Sheet Problem Pin
includeh1022-Apr-06 4:40
includeh1022-Apr-06 4:40 
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 

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.