Symantec logo

Example: Using VCSAgStartup() and script entry points on Windows

The following example shows how to build the FileOnOff agent using your own VCSAgStartup entry point. This example implements the VCSAgStartup, online, offline, and monitor entry points only.


  Note   You must first install Visual C++ on the system on which the agent will be built.


 Example: implementing agent using VCSAgStartup and script entry points

  1. Create a directory for the agent source files

    VCS_HOME%\src\agent\FileOnOff:

C:\> md %VCS_HOME%\src\agent\FileOnOff

  1. Copy the contents of the sample agent directory to the directory you created in the previous step:

C:\> copy %VCS_HOME%\src\agent\Sample\*

%VCS_HOME%\src\agent\FileOnOff

  1. Change to the new directory:

C:\> cd %VCS_HOME%\src\agent\FileOnOff

  1. Edit the file sample.C and modify the VCSAgStartup()function
    (the last several lines) to match the following example:

void VCSAgStartup() {

VCSAgInitEntryPointStruct(V50);

// Do not configure any entry points because

// this example does not implement any of them

// using C++.

VCSAgSetLogCategory(10041);

}

  1. Compile sample.C and build the agent by invoking nmake. (Makefile is provided.)

    C:\> nmake

  2. Create the following directory

    %VCS_HOME%\bin\FileOnOff:

C:\> md %VCS_HOME%\bin\FileOnOff

  1. Place the sample.dll as the FileOnOff agent library.

C:\> copy sample.dll

%VCS_HOME%\bin\FileOnOff\FileOnOff.dll

  1. Implement the online, offline, and monitor entry points.

    See Example: Using C++ entry points on Windows.