Appendix
Here's how the interface is added in as VB-accessable:
Interfaces that aren't mandatory and not yet implemented by me are left as void *, which translates to As Any in VB. Types are converted into ones that are understood by VB.Code:[ odl, uuid(947aab5f-0a5c-4c13-b4d6-4bf7836fc9f8), ] interface IFileOperation : stdole.IUnknown { // 1) (Optional) Set up your event sink. [helpstring("Not implemented. Needs IFileOperationProgressSink class module implementation.")] HRESULT Advise([in] void *pfops, [out] LONG *pdwCookie); HRESULT Unadvise([in] LONG dwCookie); // 2) Set operation state // FOF_ flags (defined in shellapi.h) and FOFX_ flags are passed here // if not specified the default flags are FOF_ALLOWUNDO | FOF_NOCONFIRMMKDIR HRESULT SetOperationFlags([in] FILEOP_FLAGS dwOperationFlags); HRESULT SetProgressMessage([in] LPCWSTR pszMessage); HRESULT SetProgressDialog([in] IOperationsProgressDialog *popd); HRESULT SetProperties([in] IPropertyChangeArray *pproparray); HRESULT SetOwnerWindow([in] LONG hwndOwner); // 3) Specify operations to take on given items. // FooItem takes an IShellItem*. // FooItems takes an IShellItem*, an IEnumShellItems* or an IDataObject*. HRESULT ApplyPropertiesToItem([in] IShellItem *psiItem); HRESULT ApplyPropertiesToItems([in] IUnknown *punkItems); HRESULT RenameItem( [in] IShellItem *psiItem, [in] LPCWSTR pszNewName, [in] void *pfopsItem); //IFileOperationProgressSink [helpstring("punkItems is either IShellItemArray, IEnumShellItems, or IDataObject")] HRESULT RenameItems( [in] IUnknown *pUnkItems, [in] LPCWSTR pszNewName); HRESULT MoveItem( [in] IShellItem *psiItem, [in] IShellItem *psiDestinationFolder, [in] LPCWSTR pszNewName, [in] void *pfopsItem); //IFileOperationProgressSink [helpstring("punkItems is either IShellItemArray, IEnumShellItems, or IDataObject")] HRESULT MoveItems( [in] IUnknown *punkItems, [in] IShellItem *psiDestinationFolder); HRESULT CopyItem( [in] IShellItem *psiItem, [in] IShellItem *psiDestinationFolder, [in] LPCWSTR pszCopyName, [in] void *pfopsItem); [helpstring("punkItems is either IShellItemArray, IEnumShellItems, or IDataObject")] HRESULT CopyItems( [in] IUnknown *punkItems, [in] IShellItem *psiDestinationFolder); HRESULT DeleteItem( [in] IShellItem *psiItem, [in] void *pfopsItem); [helpstring("punkItems is either IShellItemArray, IEnumShellItems, or IDataObject")] HRESULT DeleteItems([in] IUnknown *punkItems); HRESULT NewItem( [in] IShellItem *psiDestinationFolder, [in] LONG dwFileAttributes, [in] LPCWSTR pszName, [in] LPCWSTR pszTemplateName, [in] void *pfopsItem); // 4) Perform operations. HRESULT PerformOperations(); // 5) Were any operations aborted? HRESULT GetAnyOperationsAborted([out] LONG *pfAnyOperationsAborted); }




Reply With Quote