Click here to Skip to main content
15,917,608 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: can we call dynamic_cast in OnInitDialog #2 Pin
Nish Nishant27-Aug-02 0:41
sitebuilderNish Nishant27-Aug-02 0:41 
GeneralRe: can we call dynamic_cast in OnInitDialog #2 Pin
Tomasz Sowinski27-Aug-02 0:48
Tomasz Sowinski27-Aug-02 0:48 
GeneralHelp!! DLLs and Installation Package. Pin
gm_coll26-Aug-02 23:35
gm_coll26-Aug-02 23:35 
GeneralRe: Help!! DLLs and Installation Package. Pin
Victor Vogelpoel27-Aug-02 5:24
Victor Vogelpoel27-Aug-02 5:24 
GeneralThread Pin
Mazdak26-Aug-02 23:15
Mazdak26-Aug-02 23:15 
GeneralRe: Thread Pin
Tomasz Sowinski26-Aug-02 23:23
Tomasz Sowinski26-Aug-02 23:23 
GeneralRe: Thread Pin
Mazdak26-Aug-02 23:40
Mazdak26-Aug-02 23:40 
GeneralRe: Thread Pin
Tomasz Sowinski26-Aug-02 23:48
Tomasz Sowinski26-Aug-02 23:48 
Your problem is quite interesting. First of all, you're passing a reference to local CString, which is destroyed as soon as you leave the scope. So, depending on timing issues, your FindFile function may get correct string or not.

Easiest (but not elegant) way to solve this problem is to use global variable. You may also allocate a CString on the heap and pass a CString pointer to AfxBeginThread. In this case, FindFile would have to delete the string after it's no longer used.


Tomasz Sowinski -- http://www.shooltz.com

Free your mind and your ass will follow.

GeneralRe: Thread Pin
Mazdak27-Aug-02 0:08
Mazdak27-Aug-02 0:08 
GeneralRe: Thread Pin
Tomasz Sowinski27-Aug-02 0:16
Tomasz Sowinski27-Aug-02 0:16 
GeneralRe: Thread Pin
Mazdak27-Aug-02 0:53
Mazdak27-Aug-02 0:53 
GeneralRe: Thread Pin
Tomasz Sowinski27-Aug-02 1:00
Tomasz Sowinski27-Aug-02 1:00 
GeneralRe: Thread Pin
Mazdak27-Aug-02 1:37
Mazdak27-Aug-02 1:37 
GeneralRe: Thread Pin
Tomasz Sowinski27-Aug-02 1:39
Tomasz Sowinski27-Aug-02 1:39 
GeneralRe: Thread Pin
Mazdak27-Aug-02 2:17
Mazdak27-Aug-02 2:17 
QuestionWinsock books for MFC? Pin
Anonymous26-Aug-02 23:07
Anonymous26-Aug-02 23:07 
AnswerRe: Winsock books for MFC? Pin
Masaaki Onishi27-Aug-02 4:03
Masaaki Onishi27-Aug-02 4:03 
GeneralBest way to intercommunicate between apps Pin
EiSl26-Aug-02 22:44
EiSl26-Aug-02 22:44 
GeneralRe: Best way to intercommunicate between apps Pin
Tomasz Sowinski26-Aug-02 22:47
Tomasz Sowinski26-Aug-02 22:47 
GeneralRe: Best way to intercommunicate between apps Pin
Pavel Klocek27-Aug-02 0:36
Pavel Klocek27-Aug-02 0:36 
GeneralRe: Best way to intercommunicate between apps Pin
Christian Graus27-Aug-02 1:19
protectorChristian Graus27-Aug-02 1:19 
GeneralRe: Best way to intercommunicate between apps Pin
EiSl27-Aug-02 1:56
EiSl27-Aug-02 1:56 
GeneralRe: Best way to intercommunicate between apps Pin
Christian Graus27-Aug-02 1:56
protectorChristian Graus27-Aug-02 1:56 
GeneralNeed to help about IPX/SPX! Pin
vc_fan26-Aug-02 21:57
vc_fan26-Aug-02 21:57 
GeneralNeed help in CTreeView Pin
FASTian26-Aug-02 21:32
FASTian26-Aug-02 21:32 

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.