*
Hallo,
ich habe folgendes Problem.
In meiner Anwendung gibt es folgende Klasse:
class EXPORTER_API CMatrixEditTool : public CToolClass
{
public:
HWND Init(HWND hParent, D3DXMATRIX* pmOutMatrix, D3DXMATRIX* pmInMatrix);
void SetDestroyCallback(HWND hOutWnd, unsigned int iOutMsg, WPARAM WOutParam, LPARAM LOutParam);
void SetOkCallback(HWND hOkWnd, unsigned int iOkMsg, WPARAM WOkParam, LPARAM LOutParam);
BOOL IsValidMatrix() const;
D3DXMATRIX GetMatrix() const;
CMatrixEditTool()
{
CToolClass::m_iWindowRefCounter=0;
};
private:
D3DXMATRIX* m_pmInMatrix;
D3DXMATRIX* m_pmOutMatrix;
D3DXMATRIX m_mMatrix;
HWND m_hEditWND;
HWND m_hOutWnd;
unsigned int m_iOutMsg;
WPARAM m_WOutParam;
LPARAM m_LOutParam;
HWND m_hOkWnd;
unsigned int m_iOkMsg;
WPARAM m_WOkParam;
LPARAM m_LOkParam;
LRESULT EditMatrixProc(HWND hWnd, unsigned int iMessage, WPARAM WParam, LPARAM LParam);
static LRESULT WINAPI EditMatrixProc_(HWND hWnd, unsigned int iMessage, WPARAM WParam, LPARAM LParam);
static LRESULT WINAPI InputVectorsForInputPlaneProc_(HWND hWnd, unsigned int iMessage, WPARAM WParam, LPARAM LParam);
LRESULT InputVectorsForInputPlaneProc(HWND hWnd, unsigned int iMessage, WPARAM WParam, LPARAM LParam);
// ...
static CMatrixEditTool* GetInst(HWND hWnd)
{
return reinterpret_cast<CMatrixEditTool*>(CToolClass::GetInstance(hWnd));
}
};
Wie man unschwer erkennen kann, soll diese Klasse einen Matrixeditor darstellen, der dann irgendwo z.B. so initallisiert wird.
LRESULT WINAPI TestProc(HWND hWnd, unsigned int iMessage, WPARAM WParam, LPARAM LParam)
{
static CMatrixEditTool* pMatrixTool;
switch(iMessage)
{
case WM_CREATE:
pMatrixTool=new CMatrixEditTool;
pMatrixTool->Init(0,0);
pMatrixTool->SetDestroyCallback(hWnd, WM_USER, 0, 0);
break;
case WM_USER:
delete(pMatrixTool);
break;
default:
return DefaultWndProc(...);
}
return TRUE;
}
Als erstes Wird die Klasse initallisiert (Variablen werden Gesetzt und das Editorfenster wird erstellt) und dann wird eine Funktion aufgerufen, damit die Klasse weiß, welche Message sie and ein eventuell vorhandenes Parent-Window senden muss, wenn der Editor beendet (EditMatrixProc bekommt ein WM_DESTROY zugesendet) wird.
Leider klappt das aber nicht so, wie ich mir das dachte. Aus irgendeinem Grund werden noch weiter Messages nach dem Zerstören and das Matrixeditorfenster gesendet, was natürlich zu Fehlern führt.
Hat jemand eine Idee, wie ich es erreichen kann, das erst wirklich nach dem Zerstören des Editorfensters eine Nachricht an das Parentwindow gesent wird...
Danke,
Chrissi