Hex Editor
Hex Editor - Binary File Editing Software for Windows

IFileDocument.DeleteMulti Method

HHD Software - Hex Editor Serial Port Monitor USB Protocol Analyzer Network Monitor
 
 
 
< PreviousTopNext >
Declaration
Automation:
void  DeleteMulti ( [in]   IMultiSelection  pSel) ;
Native (C++):
HRESULT  DeleteMulti ( [in]   IMultiSelection *  pSel) ;
Parameters
pSelMultiple selection object, which describes the ranges to remove from the document.
Return Value
S_OK or standard OLE error code.
Remarks
Deletes the given multiple selection from the document. Complexity: linear-time, depending on the selection's complexity.
Examples

Deleting document's data

C++Copy Code
CComPtr<IFileDocument> pFileDocument;
if (SUCCEEDED(pFileDocument.CoCreateInstance(_T("FileDocument.FileDocument"))))
{
  if (SUCCEEDED(pFileDocument->Open(_T("c:\\temp\\file.bin"),VARIANT_FALSE)))
  {
    CComPtr<IMultiSelection> pMultiSelection;
    if (SUCCEEDED(pFileDocument->CreateEmptySelection(&pMultiSelection)))
    {
      pMultiSelection->AddRange(100,20);
      pMultiSelection->AddRange(200,30);
      pFileDocument->DeleteMulti(pMultiSelection);
      pFileDocument->Save(false);
    }
  }
}
    
< PreviousTopNext >
Copyright © 2012 HHD Software. All rights reserved.