求高人翻译以下代码为:C++,谢谢!!
function TBSCB.OnDataAvailable(grfBSCF, dwSize: DWORD;
   formatetc: PFormatEtc; stgmed: PStgMedium): HResult;
var
   Data: PByte;
   BufL, dwRead, dwActuallyRead: Cardinal;
begin
If FStarttime=0 then FStarttime:=Now;
   if FCancel or FSender.FCancel then binding.Abort else
   begin
      FBSCBTimer.enabled := False;
      FBSCBTimer.enabled := true;
      if (grfBSCF = grfBSCF or BSCF_FIRSTDATANOTIFICATION)
         then
         if (FStream = nil) and (stgmed.tymed = TYMED_ISTREAM)
            then FStream := IStream(stgmed.stm);
      dwRead := dwSize - FTotalRead;
      dwActuallyRead := 0;
      if (dwRead > 0) then
         repeat
            Data := AllocMem(dwRead + 1);
            FStream.Read(Data, dwRead, @dwActuallyRead);
            bufl := dwActuallyRead;
            if Assigned(FSender.FOnData) then
            begin
               FSender.FOnData(self, Data, bufl);
            end;
            if info.filename <> '' then
               Outputfile.WriteBuffer(Data^, bufl) else
               Stream.WriteBuffer(Data^, bufl);
            Inc(FTotalRead, dwActuallyRead);
            FreeMem(data);
         until dwActuallyRead = 0;
   end;
   Result := S_OK;
end;