Declaration
Automation:
void  PatternStatistics ( [in]   ref byte  pPattern, [in]   uint  data_size, [in]   bool  IgnoreCase, [out]   ref ulong  pDataBuffer, [in]   uint  Blocks, [in]   IMultiSelection  pSelection) ;
Native (C++):
HRESULT  PatternStatistics ( [in]   unsigned char *  pPattern, [in]   unsigned long  data_size, [in]   BOOL  IgnoreCase, [out]   unsigned __int64 *  pDataBuffer, [in]   unsigned long  Blocks, [in]   IMultiSelection *  pSelection) ;
Parameters
pPatternPointer to a patterndata_sizePattern SizeIgnoreCaseTrue to ignore case, False to perform exact matchingpDataBufferPointer to the statistics bufferBlocksNumber of blockspSelectionMultiple Selection object, containing ranges in which you want to calculate statistics.
Return Value
S_OK or standard OLE error code.
Remarks
Calculates file statistics. See the Pattern Statistics section for more information. On method return, the pDataBuffer buffer is filled with calculated statistics values. Complexity: linear-time, depending on the file's size.
Examples

Calculating Pattern Statistics

C++Copy Code
// pFileDocument and pMultiSelection are initialized elsewhere
unsigned __int64 data[1024];
unsigned char pattern[] = { 0x0d, 0x0a };
pFileDocument->PatternStatistics(pattern, sizeof(pattern), false, data, 1024, pMultiSelection);
    

See Also