I have written a component, a method of which returns a _RecordsetPtr(a smart pointer) by converting it into a LPDISPATCH pointer.
For eg: Suppose the return value of the method is LPDISPATCH *disp and one of the variables declared in the method is _RecordsetPtr rs,then in the method I say rs->QueryInterface(IID_IDispatch,(void **)disp);
But when I call this component's method to retrieve the recordset from the LPDISPATCH pointer , I say
_RecordsetPtr = disp;
This does not give an error at compile time as well as run time.But as well as it does not even display the Recordset information when I call any of its methods,say GetCount() which just retrieves the number of records in the Recordset.
Why is it so?
I can even use ADO connection ptr.
But my requirement is to use the above component and use smart pointers.
How do I convert a LPDISPATCH pointer to a _RecordsetPtr??