Instant control over file and folder operations in Windows and .NET applications

OnReadFileC event/delegate/callback


Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET   

CallbackFilter     See also    


This callback is called when CallbackFilter needs to delete the virtual file.


    property OnDeleteVirtualFile : TCbFltDeleteVirtualFileEvent;
    TCbFltDeleteVirtualFileEvent = procedure(Sender : TObject; FileName: TCBString; var UserContext: pointer) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CbFltDeleteVirtualFileEvent)(CallbackFilter* Sender, LPWSTR FileName, PVOID* UserContext);

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbFltDeleteVirtualFileEvent)(System::TObject* Sender, TCBString FileName, void * UserContext);

[C++ (.NET)]
    public delegate void CbFltDeleteVirtualFileEvent(CallbackFilter^ Sender, String^ FileName, IntPtr% UserContext);

    delegate void CbFltDeleteVirtualFileEvent(CallbackFilter^ Sender, string FileName, ref IntPtr UserContext);

    Delegate Sub CbFltDeleteVirtualFileEvent(ByVal Sender As CallbackFilter, ByVal FileName As String, ByRef UserContext As IntPtr)


  • Sender - reference to the class that called the delegate/event handler
  • FileName - contains the name of the file
  • UserContext - the placeholder for the application-defined data


This callback is called when CallbackFilter needs to delete the virtual file. As the file is virtual and your application manages virtual files, the application must do necessary cleanup in this callback / event handler.
NOTE: this event is not fired for usual (non-virtual) files.

Read more about contexts.

For description of virtual file support, read Virtual Files topic.

Error handling

See Error handling topic for detailed information about how to report errors, which occur in the event handlers, back to CallbackFilter.

See also


Back to top