🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11512

Re: IMAPI

#11512
From: Roberto
Date: Fri, 06 Feb 2004 15:08
171 lines
4539 bytes
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: <4023adef@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4020ec9e@newsgroups.borland.com> <40214ea4$1@newsgroups.borland.com> <402179d9$1@newsgroups.borland.com> <4022e5ee$1@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 07:11:29 PST
From: "Roberto" <casa@artecharao.com.br>
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>
Subject: Re: IMAPI
Date: Fri, 6 Feb 2004 13:08:21 -0200
Lines: 173
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: 200.148.45.241
Message-ID: <4023adef@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1076080111 200.148.45.241 (6 Feb 2004 07:08:31 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail