Click here to Skip to main content
15,908,675 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionerror trying to open my database 'Unrecongized database format' Pin
parims4-Oct-05 20:18
parims4-Oct-05 20:18 
AnswerRe: error trying to open my database 'Unrecongized database format' Pin
S Douglas4-Oct-05 23:24
professionalS Douglas4-Oct-05 23:24 
AnswerRe: error trying to open my database 'Unrecongized database format' Pin
Manfred Staiger4-Oct-05 23:28
Manfred Staiger4-Oct-05 23:28 
GeneralRe: error trying to open my database 'Unrecongized database format' Pin
S Douglas4-Oct-05 23:44
professionalS Douglas4-Oct-05 23:44 
QuestionCTreeCtrl::HitTest returns NULL Pin
*Dreamz4-Oct-05 19:28
*Dreamz4-Oct-05 19:28 
Questionbreakpoint format Pin
Fumber kee4-Oct-05 18:32
sussFumber kee4-Oct-05 18:32 
QuestionHow to share a structure between a thread and the main program. Pin
4-Oct-05 18:28
suss4-Oct-05 18:28 
AnswerRe: How to share a structure between a thread and the main program. Pin
Cedric Moonen4-Oct-05 20:22
Cedric Moonen4-Oct-05 20:22 
I didn't read the article you provided but I suppose its just describe a class to encapsulate the thread. Now concerning your problem: this is really simple, you just need to change the value and that's it Smile | :) . As you said, both pointers point to the same memory adress, so if you make change in your main thread, the modifications will be accessible in the other thread.

BUT, you will have to protect the data to avoid that both threads try to access it at the same time. Thus, you might look at this link[^] for CRITICAL_SECTION objects (I suppose you don't use MFC from the name of the article you gave). And look at the functions InitializeCriticalSection then EnterCriticalSection and LeaveCriticalSections to try to access your variable (EnterCriticalSection will return only when no other thread as entered the same CRITICAL_SECTION object) and finally DeleteCriticalSection to release the object.
GeneralRe: How to share a structure between a thread and the main program. Pin
Axter4-Oct-05 20:32
professionalAxter4-Oct-05 20:32 
GeneralRe: How to share a structure between a thread and the main program. Pin
Anonymous9-Oct-05 17:37
Anonymous9-Oct-05 17:37 
GeneralRe: How to share a structure between a thread and the main program. Pin
stkl6-Oct-05 20:06
stkl6-Oct-05 20:06 
QuestionHow to get the "all programs " menu handle? Pin
xavierkdna4-Oct-05 18:04
xavierkdna4-Oct-05 18:04 
QuestionProcess Name From Process handle Pin
ragavan4-Oct-05 18:00
ragavan4-Oct-05 18:00 
QuestionPosting string to window Pin
sthalasayanam4-Oct-05 17:39
sthalasayanam4-Oct-05 17:39 
AnswerRe: Posting string to window Pin
ThatsAlok4-Oct-05 18:33
ThatsAlok4-Oct-05 18:33 
GeneralRe: Posting string to window Pin
sthalasayanam5-Oct-05 16:50
sthalasayanam5-Oct-05 16:50 
GeneralRe: Posting string to window Pin
ThatsAlok5-Oct-05 17:46
ThatsAlok5-Oct-05 17:46 
QuestionEVC++ Pin
SatYr_844-Oct-05 13:40
SatYr_844-Oct-05 13:40 
AnswerRe: EVC++ Pin
SatYr_844-Oct-05 13:45
SatYr_844-Oct-05 13:45 
AnswerRe: EVC++ Pin
Rajesh match4-Oct-05 19:27
Rajesh match4-Oct-05 19:27 
GeneralRe: EVC++ Pin
SatYr_844-Oct-05 21:19
SatYr_844-Oct-05 21:19 
GeneralRe: EVC++ Pin
SatYr_844-Oct-05 21:41
SatYr_844-Oct-05 21:41 
AnswerRe: EVC++ Pin
vikas amin4-Oct-05 21:54
vikas amin4-Oct-05 21:54 
QuestionHeader File Pin
Sweet Flame4-Oct-05 11:34
Sweet Flame4-Oct-05 11:34 
AnswerRe: Header File Pin
Bartosz Bien4-Oct-05 11:55
Bartosz Bien4-Oct-05 11:55 

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.