Automation:
void
FindAll
(
[in]
ref byte
pDataToFind,
[in]
uint
data_size,
[in]
IMultiSelection
pSelection,
[in]
bool
ignore_case,
[in]
IMultiSelection
pFound)
;
Native (C++):
HRESULT
FindAll
(
[in]
unsigned char *
pDataToFind,
[in]
unsigned long
data_size,
[in]
IMultiSelection *
pSelection,
[in]
VARIANT_BOOL
ignore_case,
[in]
IMultiSelection *
pFound)
;
Parameters
pDataToFindPointer to a patterndata_sizePattern sizepSelectionMultiple Selection object, which contains ranges in which a pattern need to be locatedignore_caseTrue to ignore case, False to perform exact matching.pFoundMultiple Selection object, which contains, on method's return, all located ranges.Return Value
S_OK or standard OLE error code.
Examples
Searching all pattern occurrences
C#Copy Code
FileDocumentLib.FileDocument fdoc = new FileDocumentLib.FileDocument();
FileDocumentLib.IMultiSelection msel = fdoc.CreateEmptySelection();
FileDocumentLib.IMultiSelection mselOutput = fdoc.CreateEmptySelection();
fdoc.Open(@"c:\temp\file.txt");
msel.AddRange(0, fdoc.FileSize); // We'll be searching in a whole file
byte[] pattern = new byte[] { 0x0d, 0x0a }; // EOL pattern
fdoc.FindAll(ref pattern[0], pattern.Length, msel, false, mselOutput);
if (!mselOutput.Empty) // check if there are any matches
fdoc.Copy(mselOutput,false); // copy them to the Clipboard