From: Drakier D. <dra...@us...> - 2004-02-06 17:41:47
|
Log Message: ----------- Added Export Dlg and start of Export functionality Modified Files: -------------- /cvsroot/decaldev/source/DenAgent: DenAgent.rc DenAgentDlg.cpp DenAgentDlg.h resource.h Added Files: ----------- /cvsroot/decaldev/source/DenAgent: ExportDlg.cpp ExportDlg.h Revision Data ------------- --- NEW FILE: ExportDlg.cpp --- // ExportDlg.cpp : implementation file // #include "stdafx.h" #include "DenAgent.h" #include "ExportDlg.h" #include "DenAgentDlg.h" #include <strstream> #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // cExportDlg dialog cExportDlg::cExportDlg(CWnd* pParent /*=NULL*/) : CDialog(cExportDlg::IDD, pParent) { //{{AFX_DATA_INIT(cExportDlg) //}}AFX_DATA_INIT } cExportDlg::~cExportDlg() { m_pDecal.Release(); } void cExportDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(cExportDlg, CDialog) //{{AFX_MSG_MAP(cExportDlg) ON_BN_CLICKED(IDC_BTNEXPORT, OnBnClickedBtnexport) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // cExportDlg message handlers BOOL cExportDlg::OnInitDialog() { CDialog::OnInitDialog(); ::SendMessage( GetDlgItem( IDC_CHKENABLED )->m_hWnd, BM_SETCHECK, TRUE, 0 ); ::SendMessage( GetDlgItem( IDC_CHKLOC )->m_hWnd, BM_SETCHECK, FALSE, 0 ); ::SendMessage( GetDlgItem( IDC_CHKCLSID )->m_hWnd, BM_SETCHECK, TRUE, 0 ); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } struct cPluginGroup { LPCTSTR m_groupName, m_groupKey; int m_iconIndex; }; void cExportDlg::OnBnClickedBtnexport() { USES_CONVERSION; std::string szDelim = ", "; cPluginGroup _groups[] = { { _T( "Plugins" ), _T( "Plugins" ), 4 }, { _T( "Network Filters" ), _T( "NetworkFilters" ), 1 }, { _T( "File Filters" ), _T( "FileFilters" ), 1 }, { _T( "Services" ), _T( "Services" ), 0 }, { _T( "Surrogates" ), _T( "Surrogates" ), 3 }, { _T( "Input Actions" ), _T( "InputActions" ), 2 } }, *_end_groups = _groups + sizeof ( _groups ) / sizeof ( cPluginGroup ); int nCount = 0; std::string szOutput; szOutput += "type, "; if ( ::SendMessage( GetDlgItem( IDC_CHKENABLED )->m_hWnd, BM_GETCHECK, 0, 0 ) ) szOutput += "enabled, "; szOutput += "name, version, "; if ( ::SendMessage( GetDlgItem( IDC_CHKLOC )->m_hWnd, BM_GETCHECK, 0, 0 ) ) szOutput += "location, "; if ( ::SendMessage( GetDlgItem( IDC_CHKCLSID )->m_hWnd, BM_GETCHECK, 0, 0 ) ) szOutput += "clsid"; szOutput += "\r\n"; for ( cPluginGroup *i = _groups; i != _end_groups; ++ i ) { CComPtr<IDecalEnum> pEnum; HRESULT hRes = m_pDecal->get_Configuration ( _bstr_t ( i->m_groupKey ), GUID_NULL, &pEnum ); _ASSERTE( SUCCEEDED ( hRes ) ); while ( pEnum->Next () == S_OK ) { CLSID clsid; CComBSTR strName; CString strDLL; CString strDLLVersion; LPOLESTR szCLSID; hRes = pEnum->get_ComClass ( &clsid ); _ASSERTE ( SUCCEEDED ( hRes ) ); if ( !CDenAgentApp::getCOMObjectDLL ( clsid, strDLL ) ) strDLL = "<No DLL>"; if ( !CDenAgentApp::getVersionString ( strDLL, strDLLVersion ) ) strDLLVersion = _T( "<No Version>" ); szOutput += i->m_groupName; if ( ::SendMessage( GetDlgItem( IDC_CHKENABLED )->m_hWnd, BM_GETCHECK, 0, 0 ) ) { VARIANT_BOOL bEnabled; hRes = pEnum->get_Enabled ( &bEnabled ); _ASSERTE ( SUCCEEDED ( hRes ) ); szOutput += szDelim; szOutput += bEnabled?"1":"0"; } hRes = pEnum->get_FriendlyName( &strName ); _ASSERTE ( SUCCEEDED ( hRes ) ); szOutput += szDelim; szOutput += OLE2T ( strName ); szOutput += szDelim; szOutput += strDLLVersion; if ( ::SendMessage( GetDlgItem( IDC_CHKLOC )->m_hWnd, BM_GETCHECK, 0, 0 ) ) { szOutput += szDelim; szOutput += strDLL; } if ( ::SendMessage( GetDlgItem( IDC_CHKCLSID )->m_hWnd, BM_GETCHECK, 0, 0 ) ) { StringFromCLSID(clsid, &szCLSID); szOutput += szDelim; szOutput += OLE2T(szCLSID); ::CoTaskMemFree ( szCLSID ); } szOutput += "\r\n"; } } ::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); if (::MessageBox(NULL, "Would you like to export the data to the clipboard?", "Export Data...", MB_YESNO | MB_ICONQUESTION) == IDYES ) { if(OpenClipboard()) { char *pszData = (char*)szOutput.c_str(); HGLOBAL hData; LPVOID pData; EmptyClipboard(); hData = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE,strlen(pszData) + 1); pData = GlobalLock(hData); strcpy((LPSTR)pData, pszData); GlobalUnlock(hData); SetClipboardData(CF_TEXT, hData); CloseClipboard(); } else ::MessageBox(NULL, "Error opening clipboard!", "Error...", MB_OK | MB_ICONERROR); } } void cExportDlg::SetDecal(IDecal* pDecal) { m_pDecal = pDecal; }--- NEW FILE: ExportDlg.h --- #include "afxwin.h" #if !defined(AFX_EXPORTDLG_H__F2DBFC10_6835_494D_9A03_B97D9068BAF9__INCLUDED_) #define AFX_EXPORTDLG_H__F2DBFC10_6835_494D_9A03_B97D9068BAF9__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <Decal.h> // ExportDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // cExportDlg dialog class cExportDlg : public CDialog { // Construction public: cExportDlg(CWnd* pParent = NULL); // standard constructor ~cExportDlg(); // Dialog Data //{{AFX_DATA(cExportDlg) enum { IDD = IDD_EXPORT }; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(cExportDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(cExportDlg) virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() public: void SetDecal(IDecal* pDecal); CComPtr<IDecal> m_pDecal; afx_msg void OnBnClickedBtnexport(); }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_ExportDlg_H__F2DBFC10_6835_494D_9A03_B97D9068BAF9__INCLUDED_) Index: DenAgent.rc =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/DenAgent.rc,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- DenAgent.rc 6 Feb 2004 15:58:35 -0000 1.79 +++ DenAgent.rc 6 Feb 2004 17:39:03 -0000 1.80 @@ -81,6 +81,7 @@ LVS_NOCOLUMNHEADER | WS_TABSTOP,7,30,194,140, WS_EX_CLIENTEDGE PUSHBUTTON "Remove",IDC_DELETE,208,83,50,14 + PUSHBUTTON "Export",IDC_EXPORT,208,128,50,16 END IDD_ADDREMOVE DIALOGEX 0, 0, 301, 171 @@ -210,6 +211,25 @@ LTEXT "Total Progress:",IDC_STATUST,5,67,50,8 END +IDD_EXPORT DIALOGEX 0, 0, 231, 186 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Export Decal List" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + GROUPBOX "Export",IDC_STATIC,7,7,140,26 + CONTROL "Enabled",IDC_CHKENABLED,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,17,17,41,8 + CONTROL "Location",IDC_CHKLOC,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,61,17,41,8 + CONTROL "CLSID",IDC_CHKCLSID,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,106,17,34,8 + PUSHBUTTON "&Export",IDC_BTNEXPORT,151,11,69,20 + EDITTEXT IDC_EDITEXPORT,7,37,217,142,ES_MULTILINE | + ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | + WS_VSCROLL | WS_HSCROLL +END + ///////////////////////////////////////////////////////////////////////////// // @@ -330,6 +350,14 @@ TOPMARGIN, 7 BOTTOMMARGIN, 79 END + + IDD_EXPORT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 224 + TOPMARGIN, 7 + BOTTOMMARGIN, 179 + END END #endif // APSTUDIO_INVOKED Index: DenAgentDlg.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/DenAgentDlg.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- DenAgentDlg.cpp 15 Oct 2003 19:46:52 -0000 1.37 +++ DenAgentDlg.cpp 6 Feb 2004 17:39:03 -0000 1.38 @@ -6,12 +6,14 @@ #include "DenAgentDlg.h" #include "DownloaderDlg.h" #include "OptionsDlg.h" +#include "ExportDlg.h" #include "TrayWnd.h" #include "AutoUpdate.h" #include "..\Inject\InjectApi.h" #include "AddRemoveDlg.h" +#include ".\denagentdlg.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -54,6 +56,7 @@ ON_WM_LBUTTONUP() //}}AFX_MSG_MAP ON_BN_CLICKED(IDC_DELETE, OnBnClickedDelete) + ON_BN_CLICKED(IDC_EXPORT, OnBnClickedExport) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// @@ -335,8 +338,8 @@ if (key.QueryStringValue( _T( "DecalDirectory" ), szURLDirectory, &dwSize ) != ERROR_SUCCESS) { - ::_tcscpy(szURLDirectory, "http://decaldev.sourceforge.net"); - key.SetStringValue("DecalDirectory", "http://decaldev.sourceforge.net"); + ::_tcscpy(szURLDirectory, "http://decal.acdev.org"); + key.SetStringValue("DecalDirectory", "http://decal.acdev.org"); } dwSize = MAX_PATH; @@ -589,6 +592,10 @@ if( szXML != "" ) bSuccess = m_pDoc->loadXML( _bstr_t( szXML.c_str() ) ); + + szXML = " "; + for( int i = 0; i < 2500; ++i ) + szXML += "DIRL"; } if( !bSuccess ) @@ -828,4 +835,10 @@ //refresh loadPluginList(); } -} \ No newline at end of file +} +void CDenAgentDlg::OnBnClickedExport() +{ + cExportDlg dlg; + dlg.SetDecal(m_pDecal); + dlg.DoModal(); +} Index: DenAgentDlg.h =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/DenAgentDlg.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- DenAgentDlg.h 20 Mar 2003 22:57:21 -0000 1.14 +++ DenAgentDlg.h 6 Feb 2004 17:39:03 -0000 1.15 @@ -91,6 +91,7 @@ DECLARE_MESSAGE_MAP() public: afx_msg void OnBnClickedDelete(); + afx_msg void OnBnClickedExport(); }; //{{AFX_INSERT_LOCATION}} Index: resource.h =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/resource.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- resource.h 10 Dec 2003 19:57:30 -0000 1.25 +++ resource.h 6 Feb 2004 17:39:03 -0000 1.26 @@ -26,6 +26,7 @@ #define IDD_DOWNLOADER 143 #define IDB_GROUPS 145 #define IDC_CURSOR1 147 +#define IDD_EXPORT 152 #define IDC_PLUGINS 1001 #define IDC_REFRESH 1002 #define IDC_CHANGE_DIR 1005 @@ -54,6 +55,7 @@ #define IDC_VIEWALPHA_SPIN 1024 #define IDC_EDIT1 1028 #define IDC_CUSTOM_FONT_EDIT 1028 +#define IDC_EDITEXPORT 1028 #define IDC_BLENDINGSOFTWARE 1030 #define IDC_BLENDINGGDIPLUS 1031 #define IDC_MESSAGES_TEXT 1031 @@ -75,13 +77,18 @@ #define IDC_DELETE 1050 #define IDC_BUTTON1 1051 #define IDC_FORMATHELP 1051 +#define IDC_BTNEXPORT 1051 +#define IDC_EXPORT 1051 #define IDC_COMBO 1052 #define IDC_FORMATCLR 1052 #define IDC_FORMATSTR 1053 #define IDC_CHECK1 1054 #define IDC_OLDINJECT 1054 +#define IDC_CHKENABLED 1054 #define IDC_DUALLOG 1055 +#define IDC_CHKLOC 1055 #define IDC_WINDOWED 1056 +#define IDC_CHKCLSID 1056 #define IDC_BUTTON2 1057 #define IDC_PATCHHELP 1057 #define IDC_NOMOVIES 1058 @@ -95,7 +102,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 152 +#define _APS_NEXT_RESOURCE_VALUE 153 #define _APS_NEXT_COMMAND_VALUE 32776 #define _APS_NEXT_CONTROL_VALUE 1061 #define _APS_NEXT_SYMED_VALUE 105 |