Click here to Skip to main content
15,907,905 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: Why WTL if MFC exists ? Pin
John M. Drescher12-May-04 3:12
John M. Drescher12-May-04 3:12 
Generalembedding child activex in parent activeX Pin
Abhi Lahare30-Apr-04 20:31
Abhi Lahare30-Apr-04 20:31 
GeneralRe: embedding child activex in parent activeX Pin
Balkrishna Talele7-May-04 17:49
Balkrishna Talele7-May-04 17:49 
GeneralStatus Bars Pin
antareus28-Apr-04 16:49
antareus28-Apr-04 16:49 
GeneralRe: Status Bars Pin
nalenb29-Apr-04 15:29
nalenb29-Apr-04 15:29 
GeneralRe: Status Bars Pin
antareus30-Apr-04 0:26
antareus30-Apr-04 0:26 
GeneralATL Out-Of-Proc Server Hangs During Registion Pin
Michael Bergman28-Apr-04 8:24
Michael Bergman28-Apr-04 8:24 
GeneralWTL OnFinalMessage(){ delete this; } Pin
AstroDogDog27-Apr-04 13:36
AstroDogDog27-Apr-04 13:36 
#include <atlmisc.h>

class NewNoteWindow;
typedef CWinTraits<WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE> CMyWindowTraits;

typedef CFrameWindowImpl<NewNoteWindow, ATL::CWindow, CMyWindowTraits> CMyFrameWindow;

class NewNoteWindow : public CMyFrameWindow, public CUpdateUI<NewNoteWindow>,
public CMessageFilter, public CIdleHandler
{
public:
DECLARE_FRAME_WND_CLASS(NULL, 0)
char buf[5000000];

virtual BOOL PreTranslateMessage(MSG* pMsg)
{
return CMyFrameWindow::PreTranslateMessage(pMsg);
}

virtual BOOL OnIdle()
{
return FALSE;
}

BEGIN_UPDATE_UI_MAP(NewNoteWindow)
END_UPDATE_UI_MAP()

BEGIN_MSG_MAP(NewNoteWindow)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
CHAIN_MSG_MAP(CUpdateUI<NewNoteWindow>)
CHAIN_MSG_MAP(CMyFrameWindow)
END_MSG_MAP()

LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
return 0;
}

virtual void OnFinalMessage(HWND hWnd) {
delete this; // This is not working very well..
}

LRESULT OnCreate(LPCREATESTRUCT lparam) {
m_hWndClient = CreateWindowEx(WS_EX_CLIENTEDGE, NULL,"" , WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_CLIPCHILDREN,20, 20, 20, 20, m_hWnd, NULL, NULL, NULL);

// register object for message filtering and idle updates
CMessageLoop* pLoop = _Module.GetMessageLoop();
pLoop->AddMessageFilter(this);
pLoop->AddIdleHandler(this);

SetMsgHandled(false);

return 0;
}
};

When running the app under debug i get an Access Violation when I close the window. Why? It doesn't happen without delete this; but i see using my 5 meg buffer(in task manager) that the NewNoteWindow-object hasn't been deleted so i obviously have to delete it myself. Can someone help me make this work correctly?WTF | :WTF:
GeneralRe: WTL OnFinalMessage(){ delete this; } Pin
Michael Dunn29-Apr-04 18:34
sitebuilderMichael Dunn29-Apr-04 18:34 
GeneralRe: WTL OnFinalMessage(){ delete this; } Pin
AstroDogDog6-May-04 12:32
AstroDogDog6-May-04 12:32 
GeneralRe: WTL OnFinalMessage(){ delete this; } Pin
Solomon_III8-May-04 5:10
Solomon_III8-May-04 5:10 
GeneralRe: WTL OnFinalMessage(){ delete this; } Pin
AstroDogDog20-May-04 8:58
AstroDogDog20-May-04 8:58 
GeneralWTL 7.1 from Microsoft here Pin
TW26-Apr-04 22:33
TW26-Apr-04 22:33 
GeneralRe: WTL 7.1 from Microsoft here Pin
Jörgen Sigvardsson2-May-04 6:32
Jörgen Sigvardsson2-May-04 6:32 
GeneralRe: WTL 7.1 from Microsoft here Pin
TigerNinja_6-May-04 7:42
TigerNinja_6-May-04 7:42 
GeneralICallFactory forward declaration not resolved Pin
shahzi25-Apr-04 20:42
shahzi25-Apr-04 20:42 
QuestionUsing CSplitterWindow with MFC? Pin
Roozbeh6923-Apr-04 21:45
professionalRoozbeh6923-Apr-04 21:45 
Generalgetting Interface pointer for control created by AtlAxCreateControl Pin
Abhi Lahare22-Apr-04 19:40
Abhi Lahare22-Apr-04 19:40 
GeneralRe: getting Interface pointer for control created by AtlAxCreateControl Pin
f6426-Apr-04 12:48
f6426-Apr-04 12:48 
GeneralMail Filter Pin
Leandro H. Delamare22-Apr-04 17:53
Leandro H. Delamare22-Apr-04 17:53 
QuestionMessage for invisible control ? Pin
Sebastian S.22-Apr-04 3:34
Sebastian S.22-Apr-04 3:34 
AnswerRe: Message for invisible control ? Pin
f6422-Apr-04 15:09
f6422-Apr-04 15:09 
GeneralRe: Message for invisible control ? Pin
Sebastian S.22-Apr-04 22:14
Sebastian S.22-Apr-04 22:14 
GeneralRe: Message for invisible control ? Pin
f6423-Apr-04 13:30
f6423-Apr-04 13:30 
GeneralRe: Message for invisible control ? Pin
Sebastian S.25-Apr-04 22:13
Sebastian S.25-Apr-04 22:13 

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.