ForceFileLinking1x Example VC++

The following examples demonstrate options for file linking/copying when performing insert/append functions using 1x server files and documents.

void CAdmin1Dlg::OnFilelink() 
{
// Example 1
    // Request file being inserted into a document be copied
    // to a new file in a location to be specified.
    ImgAdmin1.SetForceFileLinking1x(FALSE);
    // To specify location of the new files, use the
    // FileStgLoc1x property.
    ImgAdmin1.SetFileStgLoc1x("Image://srvrname\\new_images:");
    // Second page of INSERTED DOC, will be inserted before page 3
    // of ORIG DOC.  Associated image files will be copied
    // to new randomly generated file names in directory specified.
    VARIANT evt;
    evt.vt = VT_ERROR;    // set to error for optional parameter
    ImgAdmin1.SetImage("Image://srvrname\\doc_db:\\CAB\\DRAWER\\
       FOLDER\\ORIG DOC");
    ImgAdmin1.Insert("Image://srvrname\\doc_db:\\CAB\\DRAWER\\FOLDER\\
       INSERTED DOC", 2, 3,1,evt,evt);

// Example 2
    // Request files associated with the page being appended
    // reference the original files.  This results in
    // multiple documents accessing the same files -- could
    // be useful to prevent rewrites of optical disk files.
    ImgAdmin1.SetForceFileLinking1x(TRUE);
    // Pages 2, 3 and 4 of 5page.tif will be appended to
    // ORIG DOC but they are actually linked back to the file.
    ImgAdmin1.SetImage("Image://srvrname\\doc_db:\\CAB\\DRAWER\\FOLDER\\
       ORIG DOC");
    ImgAdmin1.Append("Image://srvrname\\images:\\5page.tif", 2, 3,evt,evt);
}