Re: #import and CComQIPtr
I'm not really sure why did you think calling non-existent
methods through an IDispatch interface should work - they
should simply crash IMHO... What you needed is QI for
__uuidof(MSPPT::_Application) instead of IID_IDispatch.
Then again, if it was failing via the #import wrapper, it'd likely
fail via manual QI as well. You need to figure out why QI is
failing, not come up with alternative ways of calling QI.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
<keralafood@gmail.com> wrote in message
news:26884ebc-c1cb-4b17-9604-28f41850e052@e6g2000prf.googlegroups.com...
I am doing PowerPoint automation program,doing like this..
hr = GetActiveObject(clsid, NULL, (IUnknown**)&pUnk);
CComQIPtr<MSPPT::_Application> _pApplicationPtrDummy=pUnk;
it was working properly(till yesterday),but right now suddenly giving
some problem.now pApplicationPtrDummy getting only NULL,
gelast error showing 1008("An attempt was made to reference a token
that does not exist")
if i tired like this
pUnk->QueryInterface(IID_IDispatch, (void
**)&_pApplicationPtrDummy );
getting value but it seems to be
incorrect application pointer,because when i call application object
function like getAcivePresenation, giving dialog box
" Run-Time Check Failure #0 - The value of ESP was
not properly saved across a function call. This is usually a result
of calling a function declared with one calling convention with a
function pointer declared with a different calling convention".
kindly give me some guidelines,i replaced the type library file but
no luck
NB: i cannot use wrapper class way because win32 project.
i am really fed up with this error,thanks in advance.