I need help in query interface like i am getting com pointer through a function and i need to extract the data and put in the required type.
CComPtr<IModelDoc2> swDrawing = NULL; CComPtr<IDrawingDoc> swDraw = NULL; object
hRetStatus = swApp->get_IActiveDoc2 (&swDrawing);
now im getting value in swdrawing but i need the same doc info value to be stored in swdraw also but i cannot call the function again because drawingdoc doesnt support it so im doing query interface i want to know whether what i have done is right or wrong
hRetStatus = swDrawing->QueryInterface(__uuidof(IDrawingDoc), reinterpret_cast<void**> (&swDraw));