HELP!! CHtmlView (vc 10) crahes on destroy

completlely desesperated, because I dont find the error. Need some advice.
What I try:
Derive a class on CHtmlview.
and create a window with it on a dialog form.
It seems that the create function is bad, because every time if I close the dialog
or call DestroyWindow the whole thing chrashes...

I called the Create like this in OnInitDialog
1
2
3
4
5
6
7
8
  //to get the location ...
  CWnd* pw = GetDlgItem(IDC_STATIC_PICTURE);
	pw->GetWindowRect(&rc);
	ScreenToClient(&rc);

	LPCTSTR lps = AfxRegisterWndClass(0);

	BOOL b =  m_pmyhtmlviev->Create(lps,"WINDOWNAME", WS_VISIBLE|WS_CHILD|WS_HSCROLL, rc,this,0,0);


this is the header of the derived class - constructor public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

class CmyHtmlView : public CHtmlView
{
	//DECLARE_DYNCREATE(CmyHtmlView)// protected constructor used by dynamic creation

protected:

public:
	 CmyHtmlView();           
	 virtual ~CmyHtmlView();

public:
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif
	virtual void OnFinalRelease();

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
	DECLARE_DISPATCH_MAP()
	DECLARE_INTERFACE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	afx_msg void OnNcDestroy();
	virtual BOOL DestroyWindow();
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	virtual BOOL CreateEx(DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, LPVOID lpParam = NULL);
	virtual void OnInitialUpdate();
	virtual void OnNavigateComplete2(LPCTSTR strURL);
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void PreSubclassWindow();
};


for some answer I would be veeery greatful!
cheers

Topic archived. No new replies allowed.