leguignol
December 24th, 2005, 05:28 AM
Hello everybody!
I have a question on VC++.NET.
I have a project with a form with controls etc. This form lays in Form1.h. I have also an own class named Music which is in the file Music.h. Both are allocated in the same namespace. In Form1.h I included "#include Music.h" and in Music.h I included "#include Form1.h". In Form1.h I have a public method Play. When instancing an object of type Music I want to call the Play-method in Form1.h right out of constructor of Music-class. But that doesn't work. I tried to fix that with different notation like Form1::Play but nothing did work. What is the solution? Even if I declare an control on Form1 as public I cannot access it from Music.h.
I want to do this project in an very OOP way, so I came to think about events, but I don't have clue how to implement them, how to fire them and how to receive them in Form1.h.
Maybe you haven an idea how I could access Play-method. I'm very thankful for an advice.
David
I have a question on VC++.NET.
I have a project with a form with controls etc. This form lays in Form1.h. I have also an own class named Music which is in the file Music.h. Both are allocated in the same namespace. In Form1.h I included "#include Music.h" and in Music.h I included "#include Form1.h". In Form1.h I have a public method Play. When instancing an object of type Music I want to call the Play-method in Form1.h right out of constructor of Music-class. But that doesn't work. I tried to fix that with different notation like Form1::Play but nothing did work. What is the solution? Even if I declare an control on Form1 as public I cannot access it from Music.h.
I want to do this project in an very OOP way, so I came to think about events, but I don't have clue how to implement them, how to fire them and how to receive them in Form1.h.
Maybe you haven an idea how I could access Play-method. I'm very thankful for an advice.
David