Trouble with pointer to and from CMainFrame
Hi,
I'm posting this as I'm pretty desperate, I don't know how to work around this.
I'm writing a code (Visual C++ 6) in which CMainFrame class has a member of a generic (non-MFC) class CSceneManager. In turn, CSceneManager has a pointer to CMainFrame. The idea is to be able to exchange calls between both classes, as CSceneManager will be using CMainFrame as a 'user interface class' and I want CMainFrame to call CSceneManager member functions and CSceneManager to call CMainFrame functions. I don't want to use Windows Messages, as CSceneManager should be kept as much platform-independent as possible.
Thing is... I don't get it. I'm certainly missing something, probably very obvious, but it doesn't work.
I declare the CSceneManager class object m_SceneManager in CMainFrame this way:
CSceneManager m_SceneManager;
Then declare a pointer to CMainFrame in CSceneManager class:
CMainFrame *pUserInterface;
Whenever I compile this, it starts to moan it doesn't know CMainFrame or CSceneManager, even though MainFrm.h has a #include "SceneManager.h" and SceneManager.h has a #include "MainFrm.h"
I have good notions on what is a pointer, what is a reference and such matters, but I lack the experience on C++ to be sure what the hell I'm declaring and why, as I've gone into berserk mode and tried adding or deleting '*'s anywhere (which, of course, only multiplies compilation errors).
If anyone out there can give me a clue on how to solve this, it would be fantastic... I'm going nut on this and feel that it's something I've not paid attention to.
Thank you in advance.
|