OK, So there I was writing my interesting program that uses lib's, if you haven't heard about it, read my other thread...
ok, anyway, here's the story:
I'm doing a class, which uses a constructor and a destructor as follows:
class cMyWindow
{
private:
.
HWND hWnd;
char* title;
.
blah blah
.
.
.
public:
cMyWindow(HWND hwnd, const char Title);
~cMyWindow()
.
.
blah blah
.
.
};
cMyWindow::cMyWindow(HWND hwnd, const char Title)
{
this->hWnd=hwnd;
this->title=new(char[strlen(Title)+1]);
strcpy(this->title,Title);
}
~cMyWindow()
{
this->hWnd=0;
delete this->hWnd; <------THE PROBLEM GOES HERE
}
the program compiles perfectly, but when It runs over the "delete", it exits with a horrible assertion error
I don't know how to fix this!
By the way, I'm using Visual C++ 6.0 Enterprise Edition(Don't tell me not to use it because it costed me a fortune)
If anybody knows how to fix this problem, or at least knows why this is happening, tell me!
Oskilian