ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/VTBFileUtil2/VTBFileUtil2.h
(Generate patch)

Comparing trunk/VTBFileUtil2/VTBFileUtil2.h (file contents):
Revision 256 by douglas, 2003-08-15T21:56:17-07:00 vs.
Revision 271 by douglas, 2003-08-19T22:49:34-07:00

# Line 2 | Line 2
2   //
3   // Douglas Thrift
4   //
5 < // $Id: VTBFileUtil2.h,v 1.2 2003/08/16 04:56:17 douglas Exp $
5 > // $Id: VTBFileUtil2.h,v 1.10 2003/08/20 05:49:34 douglas Exp $
6  
7   #ifndef _VTBFileUtil_h_
8   #define _VTBFileUtil_h_
# Line 16 | Line 16
16   #include <sstream>
17   #include <cctype>
18   #include <vector>
19 + #include <set>
20 + #include <map>
21 + #include <cstdlib>
22  
23   #include <windows.h>
24 + #include <commctrl.h>
25 + #include <objbase.h>
26 + #include <shlobj.h>
27 + #include <shlwapi.h>
28 +
29 + #include "resource.h"
30  
31   using namespace std;
32  
33 + enum Mode { none, disc, scan };
34 + struct Gui
35 + {
36 +        HINSTANCE instance;
37 +        HICON icon;
38 + };
39 +
40   extern bool debug;
41   extern string program;
42   extern string programName;
43   extern string programVersion;
44 + extern Gui gui;
45 +
46 + void usage(HWND parent = NULL);
47 + void version(HWND parent = NULL);
48 + inline string toAnsi(const wstring& wide)
49 + {
50 +        LPSTR buffer = new CHAR[wide.length() + 1];
51 +
52 +        WideCharToMultiByte(CP_ACP, 0, wide.c_str(), wide.length() + 1, buffer,
53 +                wide.length() + 1, NULL, NULL);
54 +
55 +        return buffer;
56 + }
57 + inline wstring toWide(const string& ansi)
58 + {
59 +        LPWSTR buffer = new WCHAR[ansi.length() + 1];
60  
61 < void usage(HINSTANCE instance, HWND parent = NULL);
62 < void version(HINSTANCE instance, HWND parent = NULL);
61 >        MultiByteToWideChar(CP_ACP, 0, ansi.c_str(), ansi.length() + 1, buffer,
62 >                ansi.length() + 1);
63 >
64 >        return buffer;
65 > }
66   inline void center(HWND window)
67   {
68          RECT rect, dialog, desktop;
# Line 43 | Line 78 | inline void center(HWND window)
78          SetWindowPos(window, HWND_TOP, desktop.left + (rect.right / 2), desktop.top
79                  + (rect.bottom / 2), 0, 0, SWP_NOSIZE);
80   }
81 + inline void error(void)
82 + {
83 +        LPVOID message;
84 +
85 +        FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
86 +                FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0,
87 +                LPTSTR(&message), 0, NULL);
88 +        MessageBox(NULL, LPCTSTR(message), programName.c_str(), MB_ICONERROR);
89 +        LocalFree(message);
90 + }
91  
92   #endif // _VTBFileUtil_h_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines