- Code/Resource
- Windows Develop
- Linux-Unix program
- Internet-Socket-Network
- Web Server
- Browser Client
- Ftp Server
- Ftp Client
- Browser Plugins
- Proxy Server
- Email Server
- Email Client
- WEB Mail
- Firewall-Security
- Telnet Server
- Telnet Client
- ICQ-IM-Chat
- Search Engine
- Sniffer Package capture
- Remote Control
- xml-soap-webservice
- P2P
- WEB(ASP,PHP,...)
- TCP/IP Stack
- SNMP
- Grid Computing
- SilverLight
- DNS
- Cluster Service
- Network Security
- Communication-Mobile
- Game Program
- Editor
- Multimedia program
- Graph program
- Compiler program
- Compress-Decompress algrithms
- Crypt_Decrypt algrithms
- Mathimatics-Numerical algorithms
- MultiLanguage
- Disk/Storage
- Java Develop
- assembly language
- Applications
- Other systems
- Database system
- Embeded-SCM Develop
- FlashMX/Flex
- source in ebook
- Delphi VCL
- OS Develop
- MiddleWare
- MPI
- MacOS develop
- LabView
- ELanguage
- Software/Tools
- E-Books
- Artical/Document
PIPEIT.CPP
Package: MSDN_VC98.zip [view]
Upload User: bangxh
Upload Date: 2007-01-31
Package Size: 42235k
Code Size: 2k
Category:
Windows Develop
Development Platform:
Visual C++
- // PipeIt.cpp : Implementation of CPipeIt
- #include "stdafx.h"
- #include "pipe.h"
- #include "PipeIt.h"
- #include "resource.h"
- #include "dlgFilter.h"
- /////////////////////////////////////////////////////////////////////////////
- // CPipeIt
- HRESULT CPipeIt::OnConnection(IApplication* pApp, VARIANT_BOOL bFirstTime, long dwAddInID, VARIANT_BOOL* bOnConnection)
- {
- HRESULT hr = S_OK;
- CString strCmdFilter;
- CString strCmdNameFilter;
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
- m_spApplication = pApp;
- m_dwAddInID = dwAddInID;
- hr = pApp->SetAddInInfo((long)_Module.GetModuleInstance(),
- static_cast<IPipeIt*>(this), IDB_TOOLBAR_MEDIUM_PIPEIT, IDB_TOOLBAR_LARGE_PIPEIT, dwAddInID);
- VARIANT_BOOL bRet;
- if (SUCCEEDED(hr))
- {
- strCmdFilter.LoadString(IDS_CMD_FILTER);
- strCmdNameFilter.LoadString(IDS_CMDNAME_FILTER);
- strCmdNameFilter += _T('n');
- strCmdNameFilter += strCmdFilter;
- hr = pApp->AddCommand(CComBSTR(strCmdNameFilter),CComBSTR(_T("Filter")), 0, dwAddInID, &bRet);
- }
- // Add toolbar buttons only if this is the first time the add-in
- // is being loaded. Toolbar buttons are automatically remembered
- // by Developer Studio from session to session, so we should only
- // add the toolbar buttons once.
- if (bFirstTime)
- {
- if (SUCCEEDED(hr))
- {
- strCmdNameFilter.LoadString(IDS_CMDNAME_FILTER);
- hr = pApp->AddCommandBarButton(dsGlyph, CComBSTR(strCmdNameFilter), dwAddInID);
- }
- }
- *bOnConnection = SUCCEEDED(hr) ? VARIANT_TRUE :VARIANT_FALSE;
- return hr;
- }
- HRESULT CPipeIt::OnDisconnection(VARIANT_BOOL bLastTime)
- {
- return S_OK;
- }
- HRESULT CPipeIt::Filter()
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
- // Replace this with the actual code to execute this command
- // Use m_spApplication to access the Developer Studio Application object
- // TODO: WHAT ABOUT BEGINMODELESS??
- CDlgFilter dlgFilter;
- CComPtr<IDispatch> pDispDoc;
- m_spApplication->get_ActiveDocument(&pDispDoc);
- if (pDispDoc) // have a document open. Can reasonably do this...
- {
- dlgFilter.SetApp(m_spApplication);
- dlgFilter.DoModal();
- }
- return S_OK;
- }