Hex Editor
Hex Editor - Binary File Editing Software for Windows

IMultiSelection.Load Method

HHD Software - Hex Editor Serial Port Monitor USB Protocol Analyzer Network Monitor
 
 
 
< PreviousTopNext >
Declaration
Automation:
void  Load ( [in]   interface IStream  pStream, [in]   enum LoadMode  LoadMode) ;
Native (C++):
HRESULT  Load ( [in]   interface IStream *  pStream, [in]   enum LoadMode  LoadMode) ;
Parameters
pStreamPointer to a stream objectLoadMode Load mode. Can be one of the following values:
Load Mode Value Description
SelectionNew 0 Replaces the current selection with a one loaded from a file.
SelectionAdd 1 Combines the loaded selection with a current one.
SelectionSubtract 2 Subtracts the loaded selection from a current one.
Return Value
S_OK or standard OLE error code.
Remarks
Loads the selection from a file. This method may be instructed to merge the loaded selection with a current one, using one of supported algorithms. Due to implementation details, the Load method usually tries to read more data from the stream object, than Save method wrote to it. This is not a problem if nothing is written beyond the selection's data in a stream. Otherwise, you should prepend the selection's data in a stream with a size value and adjust the stream pointer appropriately. Complexity: linear-time, depending on current and loaded selections complexity.
Examples

Loading and Saving selection

JavaScriptCopy Code
var fdoc = new ActiveXObject("FileDocument.FileDocument");
var msel = fdoc.CreateEmptySelection();

msel.AddRange(100, 50);  // selection: [100..150)
// create a file and obtain a stream object for it
msel.Save(stream);
msel.Clear();  // selection: empty
msel.AddRange(50, 50);  // selection: [50..100)
// open a previously created selection file and obtain a stream object for it
msel.Load(stream,SelectionAdd);  // selection: [50..150)
    
< PreviousTopNext >
Copyright © 2012 HHD Software. All rights reserved.