Article View: borland.public.cppbuilder.nativeapi
Article #11384Re: IMAPI
From: Michael Harris
Date: Fri, 06 Feb 2004 23:41
Date: Fri, 06 Feb 2004 23:41
189 lines
5126 bytes
5126 bytes
I cannot tell from the snippit below.
did you look at the error codes in imapierror.h ?
Are you using CComPtr as suggested by MS ?
--
Michael
"Roberto" wrote in message
> Thanks for the Help , I creat the object TDiscMasterProgressEvents but
the
> IDiscMaster::ProgressAdvise() alway return error = 0x8000ffff
> below is my code , if you can help ??
> Thanks
> Roberto
> ------------------------------------------------------------
>
>
> //Header
>
> class TDiscMasterProgressEvents : public IDiscMasterProgressEvents
>
> {
>
> public:
>
> STDMETHOD(QueryCancel) ( boolean* pbCancel );
>
> STDMETHOD(NotifyPnPActivity) ( void);
>
> STDMETHOD(NotifyAddProgress) (long nCompletedSteps, long
> nTotalSteps);
>
> STDMETHOD(NotifyBlockProgress) (long nCompleted, long nTotal);
>
> STDMETHOD(NotifyTrackProgress) (long nCurrentTrack, long
> nTotalTracks);
>
> STDMETHOD(NotifyPreparingBurn) (long nEstimatedSeconds);
>
> STDMETHOD(NotifyClosingDisc) (long nEstimatedSeconds);
>
> STDMETHOD(NotifyBurnComplete) (HRESULT status);
>
> STDMETHOD(NotifyEraseComplete) (HRESULT status);
>
>
>
> STDMETHOD(QueryInterface) (const _GUID &arg0 ,void
> **arg1 ){return(E_NOTIMPL);};
>
> ULONG STDMETHODCALLTYPE AddRef(void ){return(AddRef());};
>
> ULONG STDMETHODCALLTYPE Release(void ){return(Release());};
>
>
>
> STDMETHODCALLTYPE TDiscMasterProgressEvents(void){};
>
> };
>
>
>
>
>
> // CPP
>
>
>
>
//--------------------------------------------------------------------------
> -
>
> // definition of TDiscMasterProgressEvents
>
> STDMETHODIMP TDiscMasterProgressEvents::QueryCancel(boolean *pbCancel)
>
> { /*code*/ return(S_OK);}
>
> ........................
>
>
>
>
//--------------------------------------------------------------------------
> -
>
> void __fastcall Tw_IMAPI::Button2Click(TObject *Sender)
>
> {
>
> HRESULT erro;
>
> CLSID Uuid, iid;
>
> IClassFactory *pO_DiskM=NULL;
>
> IDiscMaster *pDiskM=NULL;
>
> UINT_PTR pnCookie;
>
> TDiscMasterProgressEvents *pEvents = new TDiscMasterProgressEvents;
>
> if(CoInitialize(NULL)!= S_OK)
>
> return;
>
> // (520CCA63-51A5-11D3-9144-00104BA11C5E) =
> IMAPI.MSDiscMasterObj
>
>
>
if(IIDFromString(StringToOleStr("{520CCA63-51A5-11D3-9144-00104BA11C5E}"),&U
> uid)==S_OK)
>
> if(CoGetClassObject(Uuid, CLSCTX_ALL, NULL, IID_IClassFactory,
> (void**)&pO_DiskM)!=S_OK){
>
> CoUninitialize();
>
> return; }
>
> // {520CCA62-51A5-11D3-9144-00104BA11C5E} = IDiscMaster
>
>
>
if(IIDFromString(StringToOleStr("{520CCA62-51A5-11D3-9144-00104BA11C5E}"),&i
> id)==S_OK)
>
> if((erro=pO_DiskM->CreateInstance(NULL ,iid ,(void**)&pDiskM))!=S_OK){
>
> CoUninitialize();
>
> return; }
>
> pDiskM->Open();
>
>
>
> // Where is the problens happen always return error = 0x8000ffff
>
> if((erro=pDiskM->ProgressAdvise(pEvents, &pnCookie))!=S_OK) //
> retorna um objeto decendente de IEnumXXXX ; usando o m.Next() voce vai
> pegando um bloco da matriz do tipo IDiscRecorder
>
> Memo1->Lines->Append("ERRO em
> pDiskM->ProgressAdvise"+EnumMAPI_E(erro));
>
>
>
> pDiskM->Release();
>
> CoUninitialize();
>
> }
>
>
>
>
>
> "Michael Harris" <techonos-NO-SPAM-@attbi.com> escreveu na mensagem
> news:4022e5ee$1@newsgroups.borland.com...
> >
> > "Roberto" wrote in message
> >
> >
> > HRESULT STDMETHODCALLTYPE __fastcall QueryCancel( /*
> > > [retval][out] */ boolean *pbCancel) = 0;
> >
> > that may work. try something like
> >
> > header
> > STDMETHOD(QueryCancel) ( boolean* pbCancel );
> >
> > cpp
> > STDMETHODIMP TDiscMasterProgressEvents::QueryCancel( boolean* pbCancel )
> > {
> > (...)
> > return S_OK;
> > }
> >
> > --
> > Micahel
> >
> >
>
>
Technical Details
Message-ID:
<40242620$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4020ec9e@newsgroups.borland.com> <40214ea4$1@newsgroups.borland.com> <402179d9$1@newsgroups.borland.com> <4022e5ee$1@newsgroups.borland.com> <4023adef@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,6d1e2738a2e27717 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-06 15:49:05 PST Reply-To: "Michael Harris" <techonos-NO-SPAM-@attbi.com> From: "Michael Harris" <techonos-NO-SPAM-@attbi.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4020ec9e@newsgroups.borland.com> <40214ea4$1@newsgroups.borland.com> <402179d9$1@newsgroups.borland.com> <4022e5ee$1@newsgroups.borland.com> <4023adef@newsgroups.borland.com> Subject: Re: IMAPI Date: Fri, 6 Feb 2004 17:41:20 -0600 Lines: 191 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 67.162.187.132 Message-ID: <40242620$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1076110880 67.162.187.132 (6 Feb 2004 15:41:20 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail