CMainFrame which isn't a CMainFrame.. 
Author Message
 CMainFrame which isn't a CMainFrame..

i've got a function in CMainFrame which uses a this pointer to finds its way..
but i also got a SplitterWnd..
Now is the problem that whenever i use a this pointer from within that
function that instead of returning a pointer to the CMainFrame it returns a pointer to
the Splitter, this causes access violations in my program because
the part of the this pointer is embedded in a DLL..

if anyone knows how to solve this please reply..
Any help will be GREATLY appreciated..

Thanx in advance,
     Mike van Riel

-----------------** -- Posted from CodeGuru -- **-----------------
http://www.*-*-*.com/ ;  The website for Visual C++ programmers.



Mon, 23 Jul 2001 03:00:00 GMT  
 CMainFrame which isn't a CMainFrame..

Quote:
> i've got a function in CMainFrame which uses a this pointer to finds its way..
> but i also got a SplitterWnd..
> Now is the problem that whenever i use a this pointer from within that
> function that instead of returning a pointer to the CMainFrame it returns a pointer to
> the Splitter, this causes access violations in my program because
> the part of the this pointer is embedded in a DLL..

Mike,

I'm having a hard time visualizing what you are saying here. The "this"
construct _always_ represents a pointer to the object in which it is invoked.

Could you post some sample code? That would help clarify things a bit.

Jim [VC/MFC MVP]
To send mail, change spam-me-not to msn



Mon, 23 Jul 2001 03:00:00 GMT  
 CMainFrame which isn't a CMainFrame..
GetParent()

Johan Rosengren
Responsable Informatique
PACTA S.A.



Mon, 23 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to change CMainFrame's classname?

2. Why CMainFrame doesn't handle the Mouse Message

3. Sizing CMainFrame to CFormView's contents? (MFC)

4. Should CMainFrame's PreCreateWindow() get called twice ?

5. OnRButtonUp() - doesn't work from CMainFrame()

6. NULL isn't 0/0 isn't NULL

7. Get pointer to CMainFrame from within other classes?

8. Unexpected CMainFrame::OnPaint() message from ATL window that employs IWebBrowser

9. variables in cmainframe and toolbar buttons

10. background picture in MDI- CMainFrame?

11. Getting the CDC in the CMainFrame

12. How to get ptr to CMainFrame in CMyView???

 

 
Powered by phpBB® Forum Software