c++ - VC++ Access violation reading from private member value types (bool) -
i getting weird error access violation reading private class-level values (no pointers).
hresult windowedsinkrenderer::initialize(imlteesink3 *sink) { std::cout << "test\n"; // exception throw here std::cout << "test" << _isinitialized << "\n"; std::cout << "test\n"; return s_ok; }
here header
class windowedsinkrenderer { public: windowedsinkrenderer(); ~windowedsinkrenderer(); hresult initialize(imlteesink3 *sink); hresult deinitialize(); hresult setrenderowner(hwnd handle); hresult setrenderdimensions(int width, int height, bool fillvideo); hresult getcurrentimage(bitmapinfoheader* bitmapheader, byte** data, dword* size, bool* bufferhasinfoheader); private: dword _remotegraphregister; smartptr<igraphbuilder> _graphbuilder; smartptr<ifiltergraph2> _filtergraph; smartptr<imediacontrol> _mediacontrol; windowedvideorenderer* _videorenderer; bool _isinitialized; };
and here constructor event initializes bool false.
windowedsinkrenderer::windowedsinkrenderer() : _isinitialized(false) { }
what gives? why error?
0xc0000005: access violation reading location 0xcdcdcde1.
it looks calling initialize invalid pointer windowedsinkrenderer object.
Comments
Post a Comment