Click here to Skip to main content
15,889,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAny Experts Like to Challange This Questions??? Pin
percyvimal10-Nov-03 16:50
percyvimal10-Nov-03 16:50 
AnswerRe: Any Experts Like to Challange This Questions??? Pin
Dave Bryant10-Nov-03 17:08
Dave Bryant10-Nov-03 17:08 
GeneralRe: Any Experts Like to Challange This Questions??? Pin
percyvimal10-Nov-03 17:15
percyvimal10-Nov-03 17:15 
GeneralRe: Any Experts Like to Challange This Questions??? Pin
Dave Bryant10-Nov-03 17:24
Dave Bryant10-Nov-03 17:24 
GeneralRe: Any Experts Like to Challange This Questions??? Pin
percyvimal10-Nov-03 17:29
percyvimal10-Nov-03 17:29 
GeneralRe: Any Experts Like to Challange This Questions??? Pin
Antti Keskinen11-Nov-03 10:50
Antti Keskinen11-Nov-03 10:50 
GeneralIsWindow(m_hwnd) returns 0. Pin
suninwater10-Nov-03 16:48
suninwater10-Nov-03 16:48 
GeneralRe: IsWindow(m_hwnd) returns 0. Pin
Dave Bryant10-Nov-03 17:14
Dave Bryant10-Nov-03 17:14 
The remarks in MSDN for IsWindow() actually say that a thread should not call IsWindow() for a window that it did not create because the window could be destroyed after the function is called - so that's not a promising start...

Anyway, here's a couple of likely reasons for your problem:
1) Does the call to CreateWindow() succeed? If not, then obviously IsWindow() will not succeed either.
2) When does the window get destroyed? If it is destroyed in the MyClass destructor, then this will be called at the end of the scope of the MyClass object (since it is created on the stack). From the code snippet above, that means that it will be called when mainfunc() terminates, which, unless you have some sort of syncrhonisation, will be before your thread function terminates. Consequently, the window will be destroyed before the thread gets around to using it.

Dave
http://www.cloudsofheaven.org
GeneralRe: IsWindow(m_hwnd) returns 0. Pin
suninwater10-Nov-03 19:24
suninwater10-Nov-03 19:24 
GeneralRe: IsWindow(m_hwnd) returns 0. Pin
Dave Bryant11-Nov-03 8:26
Dave Bryant11-Nov-03 8:26 
GeneralRe: IsWindow(m_hwnd) returns 0. Pin
MultiThread10-Nov-03 17:27
MultiThread10-Nov-03 17:27 
GeneralRe: IsWindow(m_hwnd) returns 0. Pin
Swinefeaster10-Nov-03 18:19
Swinefeaster10-Nov-03 18:19 
GeneralCDialogBar Background color Pin
asierra10-Nov-03 16:21
asierra10-Nov-03 16:21 
GeneralDesign opinions/help needed Pin
Steve Messer10-Nov-03 16:06
Steve Messer10-Nov-03 16:06 
GeneralRe: Design opinions/help needed Pin
Antti Keskinen11-Nov-03 11:21
Antti Keskinen11-Nov-03 11:21 
GeneralRe: Design opinions/help needed Pin
Steve Messer11-Nov-03 18:05
Steve Messer11-Nov-03 18:05 
GeneralRe: Design opinions/help needed Pin
Antti Keskinen12-Nov-03 8:25
Antti Keskinen12-Nov-03 8:25 
GeneralRe: Design opinions/help needed Pin
Steve Messer12-Nov-03 12:07
Steve Messer12-Nov-03 12:07 
GeneralRe: Design opinions/help needed Pin
Antti Keskinen13-Nov-03 0:44
Antti Keskinen13-Nov-03 0:44 
GeneralRe: Design opinions/help needed Pin
Steve Messer13-Nov-03 1:35
Steve Messer13-Nov-03 1:35 
GeneralRe: Design opinions/help needed Pin
Antti Keskinen13-Nov-03 5:17
Antti Keskinen13-Nov-03 5:17 
GeneralRe: Design opinions/help needed Pin
Steve Messer13-Nov-03 7:18
Steve Messer13-Nov-03 7:18 
GeneralOnGridEndEdit and MessageBox Pin
adonisv10-Nov-03 12:48
adonisv10-Nov-03 12:48 
GeneralFILETIME compilation error Pin
rmnowick10-Nov-03 12:31
rmnowick10-Nov-03 12:31 
GeneralRe: FILETIME compilation error Pin
Dave Bryant10-Nov-03 14:04
Dave Bryant10-Nov-03 14:04 

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.