Declaration
Automation:
void  CreatePatch ( [in]   String  PatchName, [in]   enum PatchOptions  options, [in, optional]   Variant  PathToStubFile) ;
Native (C++):
HRESULT  CreatePatch ( [in]   BSTR  PatchName, [in]   enum PatchOptions  options, [in, optional]   VARIANT  PathToStubFile) ;
Parameters
PatchNameThe full path of the patch file. If file already exists, it is overwritten.options Patch options. Specify one or more of the following values:
Option Value Description
PatchNoOptions 0x00000000 No options specified.
PatchSaveFileName 0x00000001 Save file's name for later verification.
PatchCalculateHash 0x00000002 Calculate and save file's hash.
PatchRemoveReferences 0x00000004 Remove external references (currently not implemented).
PatchExecutable 0x00000008 Create a self-installing patch. PathToStubFile parameter is required if this option is used.
PathToStubFileAn optional path to an executable stub file. Should be a full path to either PatchApply32.exe or PatchApply64.exe application, installed with the Hex Editor.
Return Value
S_OK or standard OLE error code.
Remarks
Creates a patch file. See the Patch Creation section for more information on patches. Complexity: linear-time, depending on the number and complexity of operations in document's operation history.
Examples

Creating patch

C#Copy Code
// fdoc is initialized elsewhere
// Perform a modification to the file
fdoc.FillByte(0,100,20);
fdoc.CreatePatch(@"c:\patch.hexpatch",FileDocumentLib.PatchOptions.PatchCalculateHash | FileDocumentLib.PatchOptions.PatchSaveFileName,null);
    

See Also