Click here to Skip to main content
15,902,189 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionusing fstream to read resource data c++ Pin
bimgot5-Jun-07 9:48
bimgot5-Jun-07 9:48 
AnswerRe: using fstream to read resource data c++ Pin
David Crow5-Jun-07 10:12
David Crow5-Jun-07 10:12 
GeneralRe: using fstream to read resource data c++ Pin
bimgot5-Jun-07 14:00
bimgot5-Jun-07 14:00 
QuestionAsynchronous Cross-thread Signaling Pin
Cyrilix5-Jun-07 7:23
Cyrilix5-Jun-07 7:23 
AnswerRe: Asynchronous Cross-thread Signaling Pin
KellyR5-Jun-07 8:38
KellyR5-Jun-07 8:38 
AnswerRe: Asynchronous Cross-thread Signaling Pin
Matthew Faithfull5-Jun-07 8:44
Matthew Faithfull5-Jun-07 8:44 
GeneralRe: Asynchronous Cross-thread Signaling Pin
Cyrilix5-Jun-07 8:49
Cyrilix5-Jun-07 8:49 
GeneralRe: Asynchronous Cross-thread Signaling Pin
Matthew Faithfull5-Jun-07 9:10
Matthew Faithfull5-Jun-07 9:10 
I don't know if this would work. I suspect the event function would get called on the child thread or a temporary thread rather than on the main thread.
Although Microsoft labels all this up as 'Native' you'll notice the bracketed [event_source(native)] attributes indicating managed extensions. I guess this probably works like the COM event system where the child thread will get temporarily suspended when it raises the event and then the rutime will actually scrape up (probably from a pool ) a separate system thread to call the event handler on, releasing the child thread to go its merry way after the hand off of any parameters. You could do this in straight C++ but being able to hand off any set of parameters is, I suspect, what's going to require the compiler magic indicated by [event_source(native)]. It's going to have to write some code for you based on the definition of the event class Smile | :)
Personally I would use a straight forward Event object and have the main thread poll (WaitForSingleObject with a short timeout) for it periodically.

Nothing is exactly what it seems but everything with seems can be unpicked.

GeneralRe: Asynchronous Cross-thread Signaling Pin
Cyrilix5-Jun-07 10:04
Cyrilix5-Jun-07 10:04 
GeneralRe: Asynchronous Cross-thread Signaling Pin
Matthew Faithfull5-Jun-07 10:57
Matthew Faithfull5-Jun-07 10:57 
QuestionCAsyncSocket::Connect Pin
kcynic5-Jun-07 7:06
kcynic5-Jun-07 7:06 
AnswerRe: CAsyncSocket::Connect Pin
Mark Salsbery5-Jun-07 7:29
Mark Salsbery5-Jun-07 7:29 
Questionsqltypes.h giving error Pin
Programm3r5-Jun-07 6:21
Programm3r5-Jun-07 6:21 
AnswerRe: sqltypes.h giving error Pin
Reagan Conservative5-Jun-07 6:33
Reagan Conservative5-Jun-07 6:33 
QuestionRe: sqltypes.h giving error Pin
Programm3r5-Jun-07 7:30
Programm3r5-Jun-07 7:30 
AnswerRe: sqltypes.h giving error Pin
Mark Salsbery5-Jun-07 8:23
Mark Salsbery5-Jun-07 8:23 
GeneralRe: sqltypes.h giving error Pin
Programm3r5-Jun-07 8:39
Programm3r5-Jun-07 8:39 
GeneralRe: sqltypes.h giving error Pin
Mark Salsbery5-Jun-07 8:49
Mark Salsbery5-Jun-07 8:49 
GeneralRe: sqltypes.h giving error Pin
Programm3r5-Jun-07 8:51
Programm3r5-Jun-07 8:51 
GeneralRe: sqltypes.h giving error Pin
Mark Salsbery5-Jun-07 9:00
Mark Salsbery5-Jun-07 9:00 
GeneralRe: sqltypes.h giving error Pin
Programm3r5-Jun-07 19:21
Programm3r5-Jun-07 19:21 
GeneralRe: sqltypes.h giving error Pin
Mark Salsbery6-Jun-07 4:40
Mark Salsbery6-Jun-07 4:40 
QuestionDrive types Pin
RomTibi5-Jun-07 6:07
RomTibi5-Jun-07 6:07 
AnswerRe: Drive types Pin
Hans Dietrich5-Jun-07 6:46
mentorHans Dietrich5-Jun-07 6:46 
GeneralRe: Drive types Pin
RomTibi5-Jun-07 8:39
RomTibi5-Jun-07 8:39 

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.