Original Post
Hi, I've got a class called CMain, which holds the pointer CWindow* window. and the user can create a window by calling createWindow(), which points the window to a new memory, eg new CWindow(). When returning a window, i wanted to return it as a const, so the pointer can't be redirected. const CWindow* getWindow(); but when calling it: ShowWindow(getWindow()->getWnd(), SW_SHOW); i get the error:
Quote:So I have to use CWindow* getWindow(); instead, but now the pointer can be modified. Is there any way around this? Thanks btw The place where ShowWindow is being called has inherited the CMain class.
error C2662: 'CWindow::getWnd' : cannot convert 'this' pointer from 'const CWindow' to 'CWindow &'