VTBL
-
I will try to write question shortly :) struct CEvents { virtual HRESULT Method1() = 0; virtual HRESULT Method2() = 0; virtual HRESULT Method3() = 0; }; class A : public CEvents { // Implementation of VTBL methods virtual HRESULT Method1(); virtual HRESULT Method2(); virtual HRESULT Method3(); HRESULT Some(); B *m_B; }; HRESULT Some() { m_b->Initialize( (CEvents*)this ); return S_OK; } class B { CEvents *m_evs; HRESULT Initialize( CEvents *evs ); } HRESULT B::Initialize( CEvents *evs ) { ///////////////////// THIS IS MY QUESTION ///////////////// // This i have trouble... access violation and ect.... // But when i use not pointer to class B as member of A ( B *m_B; ) // there is no any problems - PLEASE, TOLD ME, WHY?????????????? m_evs = evs; return S_OK; }
ISQ 469907496
-
I will try to write question shortly :) struct CEvents { virtual HRESULT Method1() = 0; virtual HRESULT Method2() = 0; virtual HRESULT Method3() = 0; }; class A : public CEvents { // Implementation of VTBL methods virtual HRESULT Method1(); virtual HRESULT Method2(); virtual HRESULT Method3(); HRESULT Some(); B *m_B; }; HRESULT Some() { m_b->Initialize( (CEvents*)this ); return S_OK; } class B { CEvents *m_evs; HRESULT Initialize( CEvents *evs ); } HRESULT B::Initialize( CEvents *evs ) { ///////////////////// THIS IS MY QUESTION ///////////////// // This i have trouble... access violation and ect.... // But when i use not pointer to class B as member of A ( B *m_B; ) // there is no any problems - PLEASE, TOLD ME, WHY?????????????? m_evs = evs; return S_OK; }
ISQ 469907496
-
I will try to write question shortly :) struct CEvents { virtual HRESULT Method1() = 0; virtual HRESULT Method2() = 0; virtual HRESULT Method3() = 0; }; class A : public CEvents { // Implementation of VTBL methods virtual HRESULT Method1(); virtual HRESULT Method2(); virtual HRESULT Method3(); HRESULT Some(); B *m_B; }; HRESULT Some() { m_b->Initialize( (CEvents*)this ); return S_OK; } class B { CEvents *m_evs; HRESULT Initialize( CEvents *evs ); } HRESULT B::Initialize( CEvents *evs ) { ///////////////////// THIS IS MY QUESTION ///////////////// // This i have trouble... access violation and ect.... // But when i use not pointer to class B as member of A ( B *m_B; ) // there is no any problems - PLEASE, TOLD ME, WHY?????????????? m_evs = evs; return S_OK; }
ISQ 469907496
I don't see anywhere that you actually create any objects. You have pointers declared but they are uninitialized. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
ha, ha i so stuped!!! :) i forgot to do new B!!! :) i work to long... overwork oneself :) :) :) sory for this mes... :)
ISQ 469907496
-
I don't see anywhere that you actually create any objects. You have pointers declared but they are uninitialized. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
actually it was shortly sample...
ISQ 469907496
-
actually it was shortly sample...
ISQ 469907496
How should we help you then? What errors are you getting? On what line(s)? Compile or runtime? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
How should we help you then? What errors are you getting? On what line(s)? Compile or runtime? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
i have write answer for my question above... see third reply... :) i am ashamed of myself.... :)
ISQ 469907496
-
i have write answer for my question above... see third reply... :) i am ashamed of myself.... :)
ISQ 469907496
might be some one is intrested in the answer!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You