Click here to Skip to main content
15,909,498 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Sorry people ... Pin
arturapps21-Aug-03 2:44
arturapps21-Aug-03 2:44 
GeneralRe: Sorry people ... Pin
PJ Arends21-Aug-03 4:47
professionalPJ Arends21-Aug-03 4:47 
GeneralHelp with storing pointers.. Pin
RobJones20-Aug-03 9:07
RobJones20-Aug-03 9:07 
GeneralRe: Help with storing pointers.. Pin
Neville Franks20-Aug-03 10:39
Neville Franks20-Aug-03 10:39 
GeneralRe: Help with storing pointers.. Pin
John R. Shaw20-Aug-03 12:19
John R. Shaw20-Aug-03 12:19 
GeneralRe: Help with storing pointers.. Pin
RobJones20-Aug-03 13:19
RobJones20-Aug-03 13:19 
GeneralRe: Help with storing pointers.. Pin
RobJones21-Aug-03 4:23
RobJones21-Aug-03 4:23 
GeneralRe: Help with storing pointers.. Pin
igor196020-Aug-03 20:42
igor196020-Aug-03 20:42 
I maybe wrong here (as usual), but:
From looking into that line of code:
CWnd *pNewWnd = CWnd::FindWindow(NULL,_T("The Client App Name"));

I would assume that "The Client App Name" window doesn't belong to your module (it's not this module that created it).

If my assumption is true, then CWnd::FindWindow returns temporary CWnd object.

Therefore that temporary CWnd object maybe already deleted at the time you are using it later.

Solution:
Instead of storing CWnd* -- store HWND, like that:

// In header<br />
struct s_windows{<br />
    HWND hWnd;<br />
};


Regards

"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
GeneralDisabling WinLogo Key on the KeyBoard Pin
ZarrinPour20-Aug-03 7:55
ZarrinPour20-Aug-03 7:55 
GeneralRe: Disabling WinLogo Key on the KeyBoard Pin
David Crow20-Aug-03 9:07
David Crow20-Aug-03 9:07 
GeneralRe: Disabling WinLogo Key on the KeyBoard Pin
John M. Drescher20-Aug-03 17:56
John M. Drescher20-Aug-03 17:56 
QuestionHow can I do simultaneous scrolling of 2 wnd? Pin
Sonin Nickolay20-Aug-03 7:25
Sonin Nickolay20-Aug-03 7:25 
AnswerRe: How can I do simultaneous scrolling of 2 wnd? Pin
John R. Shaw20-Aug-03 7:41
John R. Shaw20-Aug-03 7:41 
GeneralRe: How can I do simultaneous scrolling of 2 wnd? Pin
Sonin Nickolay20-Aug-03 19:06
Sonin Nickolay20-Aug-03 19:06 
GeneralRe: How can I do simultaneous scrolling of 2 wnd? Pin
John R. Shaw21-Aug-03 7:25
John R. Shaw21-Aug-03 7:25 
Generaldirect access to interrupts Pin
manusha20-Aug-03 7:12
manusha20-Aug-03 7:12 
GeneralRe: direct access to interrupts Pin
David Crow20-Aug-03 7:54
David Crow20-Aug-03 7:54 
GeneralRe: direct access to interrupts Pin
Ryan Binns21-Aug-03 0:08
Ryan Binns21-Aug-03 0:08 
QuestionHTML in Application? Pin
superstein20-Aug-03 6:09
superstein20-Aug-03 6:09 
AnswerRe: HTML in Application? Pin
HPSI20-Aug-03 6:25
HPSI20-Aug-03 6:25 
AnswerRe: HTML in Application? Pin
Neville Franks20-Aug-03 10:44
Neville Franks20-Aug-03 10:44 
QuestionHow can I make a scroll window like CScrollView? Pin
mizimizi20-Aug-03 6:05
mizimizi20-Aug-03 6:05 
AnswerRe: How can I make a scroll window like CScrollView? Pin
Shog920-Aug-03 7:10
sitebuilderShog920-Aug-03 7:10 
Generalmath question... Pin
Maximilien20-Aug-03 5:59
Maximilien20-Aug-03 5:59 
GeneralRe: math question... Pin
ZoogieZork20-Aug-03 8:20
ZoogieZork20-Aug-03 8:20 

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.