Yes, I have included #include "mainframe.h" into the InstructionMemory class, but I am getting the following error for some reason:
1 2 3 4 5 6 7 8 9 10 11
main.cpp
1>c:\users\kraigballa\documents\visual studio 2010\projects\form builder\im.h(40) : error C2061: syntax error : identifier 'MainFrame'
1>c:\users\kraigballa\documents\visual studio 2010\projects\form builder\im.h(115) : error C2065: 'theFrame' : undeclared identifier
1>c:\users\kraigballa\documents\visual studio 2010\projects\form builder\im.h(115) : error C2227: left of '->OnImLoadDecode' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>mainframe.cpp
1>c:\users\kraigballa\documents\visual studio 2010\projects\form builder\im.h(40) : error C2061: syntax error : identifier 'MainFrame'
1>c:\users\kraigballa\documents\visual studio 2010\projects\form builder\im.h(115) : error C2065: 'theFrame' : undeclared identifier
1>c:\users\kraigballa\documents\visual studio 2010\projects\form builder\im.h(115) : error C2227: left of '->OnImLoadDecode' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>.\mainframe.cpp(70) : error C2660: 'InstructionMemory::decode' : function does not take 2 arguments
Even though decode is setup for two parameters I am still getting the above error. Here is the command from mainframe.cpp:
I don't understand why this is not working..it seems like the frame object is not being passed correctly. I have looked around and '*this' is the frame object...so it should work. Any ideas?
mainframe.h includes im.h
im.h includes mainframe.h
In im.h you only use pointers to mainframe. So just forward declare class Mainframe; on the top
You need headers guards too. http://cplusplus.com/forum/articles/10627/ (3 to 7)
Don't using on headers. (it'll corrupt everything that follows)