Hello,
I have a class called 'VideoPlayer', in which I create an object of another class called 'MenuBar'.
In the 'MenuBar' class I handle mouse events. If one of the buttons in the 'MenuBar' object is clicked, I want to call a function in the 'VideoPlayer' object.
I figured I should send a pointer to the 'VideoPlayer' object to the 'MenuBar' object, so I can access the 'VideoPlayer' object's functions. However, when I include the header file for the 'VideoPlayer' class into the 'MenuBar' class, I get compiler errors:
1 2 3 4 5
|
1>ClCompile:
1> hvMenuBar.cpp
1>.\src\VideoPlayer.h(51): error C2146: syntax error : missing ';' before identifier 'menu'
1>.\src\VideoPlayer.h(51): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\src\VideoPlayer.h(51): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
|
I guess I'm going about it wrong. Any way I try to make a link to the 'parent' class, I get into trouble. I think it's because I'm basically making an #include loop, which includes each other. Simply put I don't know how to do it.
If anyone could point me in the good direction, I'd be very grateful.
Kind regards,
Harry Vermeulen