Changeset 687
- Timestamp:
- 12/2/2008 1:45:04 AM (4 years ago)
- Location:
- branches/erasershellext/cpp
- Files:
-
- 2 deleted
- 4 edited
-
CtxMenu.cpp (modified) (4 diffs)
-
CtxMenu.h (modified) (6 diffs)
-
EraserCtxMenu_i.c (modified) (1 diff)
-
EraserCtxMenu_i.h (modified) (1 diff)
-
EraserCtxMenu_p.c (deleted)
-
dlldata.c (deleted)
Legend:
- Unmodified
- Added
- Removed
-
branches/erasershellext/cpp/CtxMenu.cpp
r684 r687 8 8 9 9 namespace Eraser { 10 HRESULT CCtxMenu::Initialize( 11 LPCITEMIDLIST pidlFolder, 12 LPDATAOBJECT pDataObj, 13 HKEY hProgID ) 10 HRESULT CCtxMenu::Initialize(LPCITEMIDLIST /*pidlFolder*/, LPDATAOBJECT pDataObj, 11 HKEY /*hProgID*/) 14 12 { 15 13 FORMATETC fmt = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; … … 295 293 HRESULT result = E_INVALIDARG; 296 294 // final eraser command to call 297 string_type command( S("eraser "));298 string_type files (S("")), directories(S("")), unuseds(S(""));295 string_type command(L"eraser "); 296 string_type files, directories, unuseds; 299 297 300 298 // compile the eraser command syntax 301 foreach(file, m_szSelectedFiles) files += S("\"") + *file + S("\" "); 302 foreach(unused, m_szSelectedUnused) unuseds += S("--unused=\"") + *unused + S("\""); 303 foreach(directory, m_szSelectedDirectories) directories += S("--dir=\"") + *directory + S("\" "); 299 for (string_list::const_iterator i = m_szSelectedFiles.begin(); 300 i != m_szSelectedFiles.end(); ++i) 301 { 302 files += L"\"" + *i + L"\" "; 303 } 304 for (string_list::const_iterator i = m_szSelectedUnused.begin(); 305 i != m_szSelectedUnused.end(); ++i) 306 { 307 unuseds += L"--unused=\"" + *i + L"\" "; 308 } 309 for (string_list::const_iterator i = m_szSelectedDirectories.begin(); 310 i != m_szSelectedUnused.end(); ++i) 311 { 312 directories += L"--dir=\"" + *i + L"\" "; 313 } 304 314 305 315 // Get the command index. … … 308 318 case CERASER_ERASE: 309 319 { 310 command += S("addtask ")+ files + unuseds + directories;320 command += L"addtask " + files + unuseds + directories; 311 321 //result = system(command.c_str()); 312 322 break; … … 334 344 break; 335 345 } 336 case CERASER_ ENUM(CEraserLPVERBS::CERASER_CONSOLE):346 case CERASER_CONSOLE: 337 347 { 338 348 // interactive eraser console -
branches/erasershellext/cpp/CtxMenu.h
r686 r687 1 1 // CtxMenu.h : Declaration of the CCtxMenu 2 3 2 #pragma once 4 3 5 #include "resource.h" // main symbols 6 4 #include "resource.h" 7 5 #include "EraserCtxMenu_i.h" 8 6 … … 15 13 #include <fstream> 16 14 17 #define CERASER_ENUM_TYPE unsigned int18 #define CERASER_ENUM(x) ((CERASER_ENUM_TYPE)x)19 #define foreach(iter, container) \20 for(string_list::iterator iter = container.begin(); \21 iter != container.end(); iter++)22 23 #define GCNEW(object_type,...) \24 *(CCtxMenu::GCNew(new object_type(__VA_ARGS__)))25 26 #define S(str) L ## str27 28 #ifdef _DEBUG29 #define DebugMessageBox(...) MessageBox(__VA_ARGS__)30 static HWND DebugHWND =31 CreateWindow(0, _T("Eraser Debug Windows"), 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL);32 #else33 #define DebugMessageBox(...) ;;;;;;;;;;;;;;;;;;;;;;;34 #endif35 36 15 namespace Eraser 37 16 { 38 typedef std::wstring string_type; 39 typedef std::list<string_type > string_list; 40 typedef std::list<void*> gc; 41 17 typedef std::wstring string_type; 18 typedef std::list<string_type> string_list; 42 19 43 20 enum CEraserSecureMove … … 60 37 // ); 61 38 62 if (!CopyFile(src.c_str(), dst.c_str(), FALSE))39 if (!CopyFile(src.c_str(), dst.c_str(), FALSE)) 63 40 { 64 41 //file.Close(); … … 67 44 68 45 // successfull copy, add for erasure 69 70 46 } 71 47 72 // CCtxMenu73 48 class ATL_NO_VTABLE CCtxMenu : 74 49 public CComObjectRootEx<CComSingleThreadModel>, … … 103 78 104 79 protected: 105 gc m_GC;106 80 string_list m_szSelectedFiles; 107 81 string_list m_szSelectedDirectories; 108 string_list m_szSelectedUnused; 109 HBITMAP m_szEraserIcon; 110 111 112 template<typename T> 113 T* GCNew(T* pointer) 114 { 115 this->m_GC.push_back(reinterpret_cast<void*>(pointer)); 116 return pointer; 117 } 118 82 string_list m_szSelectedUnused; 83 HBITMAP m_szEraserIcon; 119 84 120 85 public: … … 125 90 COM_INTERFACE_ENTRY(IContextMenu) 126 91 END_COM_MAP() 92 127 93 DECLARE_PROTECT_FINAL_CONSTRUCT() 128 94 HRESULT FinalConstruct() 129 95 { 130 96 return S_OK; 131 }132 133 void FinalRelease()134 {135 for(gc::iterator i = m_GC.begin(); i != m_GC.end(); i++)136 delete *i;137 97 } 138 98 }; -
branches/erasershellext/cpp/EraserCtxMenu_i.c
r684 r687 7 7 8 8 /* File created by MIDL compiler version 7.00.0500 */ 9 /* at Tue Dec 02 0 8:53:4320089 /* at Tue Dec 02 09:39:06 2008 10 10 */ 11 11 /* Compiler settings for .\EraserCtxMenu.idl: -
branches/erasershellext/cpp/EraserCtxMenu_i.h
r684 r687 5 5 6 6 /* File created by MIDL compiler version 7.00.0500 */ 7 /* at Tue Dec 02 0 8:53:4320087 /* at Tue Dec 02 09:39:06 2008 8 8 */ 9 9 /* Compiler settings for .\EraserCtxMenu.idl:
Note: See TracChangeset
for help on using the changeset viewer.
