Compiler Fehler?
-
Hallo,
Ich habe 2 Klasse die miteinander kommunizieren. Nun habe ich folgendes Problem. Wenn ich der Klasse eine weitere 4 Byte Varaible zufüge, so stürtzt das Programm beim Destrucktor aufruf ab.
Die Absturzmessage von Windows lautet:
Debug Error!
DAMAGE: after Normal Block (#48) at 0x00499...Hier meine Klassen definition:
// MagicDrawClient.h: interface for the CMagicDrawClient class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_MAGICDRAWCLIENT_H__03F5E2B2_F803_43A9_9FFE_7C309361B405__INCLUDED_) #define AFX_MAGICDRAWCLIENT_H__03F5E2B2_F803_43A9_9FFE_7C309361B405__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MultiServer.h" #include "ChannelTable.h" #include <string> #include <iostream.h> #define MAX_ACTION_HANDLER 7 #define INC_BUFFER_SIZE 1490 struct strAktionData { WORD wParaLen; BYTE * vpParamData; }; class CMagicDrawClient : public CBasicClient { public: CMagicDrawClient(CMultiServer<CMagicDrawClient> * pServer, unsigned int nBufferSize, SOCKET s, unsigned int nID, void * par); virtual ~CMagicDrawClient(); void DataAvaible(); const char * GetUserName(); void SendChannelList(); private: CChannelTable * m_pChannelTable; CChannel * m_pMyChannel; int m_nChatID; std::string * m_pstrUsername; BYTE m_bColor; //int i; //kommentiere ich diese Zeile aus, so stürzt das Programm beim Destrucktor aufruf ab bool bWriteable; void LeftMyChannel(); void ExecuteBuffer(BYTE * Buffer, unsigned int len); bool IsLogged(); void SendMatrix(); void StopSending(); static DWORD WINAPI SendMatrixAsnc(LPVOID Data); //Standart Antworten void ReplyStatus(BYTE Status); //EventHandler bool (CMagicDrawClient::*pfncAktionHandler[MAX_ACTION_HANDLER] )(strAktionData &); //Aktion Handlers bool LogIn( strAktionData & Data); bool Logout( strAktionData & Data); bool GetChannellist( strAktionData & Data); bool JoinChannel( strAktionData & Data); bool LeftChannel( strAktionData & Data); bool SendChannelMessage( strAktionData & Data); bool SetPixel( strAktionData & Data); }; #endif // !defined(AFX_MAGICDRAWCLIENT_H__03F5E2B2_F803_43A9_9FFE_7C309361B405__INCLUDED_)Wie kann das sein das beim einer weiteren Varibale das Programm beim Löschen einer Klasse abstürzt?
Gruß Stu
-
Du machst dir irgendwie deinen Speicher kaputt. Etwas, was bei verschiedenen Klassengrößen unterschiedliche Auswirkungen hat. Hier wäre ein Tool angebracht, das dir Hilft solche Probleme zu finden. Ich kenne nur valgrind, aber das läuft nur unter Linux.
-
ich danke dir für deine Antwort, werde es mal testen.