Returns a ExDataObjectFiles collection, which in turn contains a list of all filenames
used by a ExDataObject object.
Type | Description | |||
ExDataObjectFiles | An ExDataObjectFiles object that contains a list of filenames used in OLE drag and drop operations. |
For instance, when the ExDataObject's format is exCFFiles, the Files property retrieves the files that were dropped to the ExFileView control. The control fires the OLEStartDrag event to notify your application that the user stars dragging files. The OLEDragDrop event notifies your application that the user drags some data on the control.
The following VB sample displays the list of files being dragged to the control ( open your Windows Explorer, select some files and drag them to the control ) :
Private Sub ExFileView1_OLEDragDrop(ByVal Data As EXFILEVIEWLibCtl.IExDataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) With Data.Files Dim i As Long For i = 0 To .Count - 1 Debug.Print .Item(i) Next End With End Sub
The following C++ sample displays the list of files being dragged to the control:
#import <exfilevw.dll> void OnOLEDragDropExfileview1(LPDISPATCH Data, long FAR* Effect, short Button, short Shift, long X, long Y) { EXFILEVIEWLib::IExDataObjectPtr spData( Data ); if ( spData ) { EXFILEVIEWLib::IExDataObjectFilesPtr spFiles = spData->Files; for ( long i = 0; i < spFiles->Count; i++ ) OutputDebugString( spFiles->Item[ i ] ); } }
The C++ requires #import <exfilevw.dll> to import definitions for ExDataObject and ExDataObjectFiles objects. The #import <exfilevw.dll> generates the EXFILEVIEWLib namespace. If the exfilevw.dll file is located in other directory than system folder, the correct path should be provided, else a compiler error occurs.
The following VB.NET sample displays the list of files being dragged to the control:
Private Sub AxExFileView1_OLEDragDrop(ByVal sender As Object, ByVal e As AxEXFILEVIEWLib._IExFileViewEvents_OLEDragDropEvent) Handles AxExFileView1.OLEDragDrop With e.data.Files Dim i As Long For i = 0 To .Count - 1 Debug.WriteLine(.Item(i)) Next End With End Sub
The following C# sample displays the list of files being dragged to the control:
private void axExFileView1_OLEDragDrop(object sender, AxEXFILEVIEWLib._IExFileViewEvents_OLEDragDropEvent e) { EXFILEVIEWLib.ExDataObjectFiles files = e.data.Files; for (int i = 0; i < files.Count; i++) System.Diagnostics.Debug.WriteLine(files[i]); }
The following VFP sample displays the list of files being dragged to the control:
*** ActiveX Control Event *** LPARAMETERS data, effect, button, shift, x, y With data.Files local i For i = 0 To .Count - 1 wait window nowait .Item(i) Next EndWith