VcsInitEventAddin
Return to Introduction  Previous page  Next page
This, required, function should be exported from all addins. It is used to initialize the addin and is called when the Addin is first loaded.

procedure VcsInitEventAddin( const pName: PChar;   
                             GetUserProc: TGetUserInfo;   
                             GetFileProc: TGetFileInfo ); stdcall; export;  

If you allocate memory or resources in the Addin, you can use the VcsReleaseAddin function to release it.

Parameters

Name
Description
pName (out)
Return a descriptive name for this addin in this parameter.
GetUserProc
TC will pass in a pointer to a function of type TGetUserInfo that can be called from within the addin to get basic user information. In addition you have full access to the Direct API
Name
TC will pass in a pointer to a function of type TGetFileInfo that can be called from within the addin to get basic archive information. In addition you have full access to the Direct API


Example (Delphi)

type  
  TGetUserInfo = function ( UID: Cardinal; const pName, pFullName, pEMail, pLocation, pExtra: PChar ): Integer; stdcall;  
  TGetFileInfo = function ( FileID: Cardinal; const pName, pLockedBy, pExtra: PChar; var TimeStamp, FileDate: Integer; var Virtual, Frozen, Removed: Boolean ): Integer; stdcall;  
 
var  
  GetUserInfo: TGetUserInfo = nil;  
  GetFileInfo: TGetFileInfo = nil;  
 
procedure VcsInitEventAddin( const pName: PChar; GetUserProc: TGetUserInfo; GetFileProc: TGetFileInfo );  
begin  
  // This procedure is called when the addin is first loaded  
  // Use it to initialize internal variables.  
  StrCopy( pName, 'Dummy Addin' );  
  // Store the passed function pointers for later use...  
  GetUserInfo := GetUserProc;  
  GetFileInfo := GetFileProc;  
end;  
 
 

 


© 1995-2018 MCN Software