| webservice系列教学(11)-如何调用webservice(vc2) |
| 日期:2006-9-9 10:17:10 人气: [大 中 小] |
<MClientDlg.h> // MClientDlg.h : header file // #if !defined(AFX_MCLIENTDLG_H__C2D8DBC4_30FE_40DD_848C_78D5834CAD07__INCLUDED_) #define AFX_MCLIENTDLG_H__C2D8DBC4_30FE_40DD_848C_78D5834CAD07__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 ///////////////////////////////////////////////////////////////////////////// // CMClientDlg dialog class CMClientDlg : public CDialog { // Construction public: void EnableButtons(); void DisableButtons(); void AssignpRef(VARIANT *var1, VARIANT *var2); void assignItem(LVITEM *item, UINT mask, int iItem, int iSubItem, LPTSTR pszText, int cchTextMax); int UpdateList(); bool DestroyTree(); int CheckforURL(); int ModifyDialog(); void Execute(); int nCountParameter(); HTREEITEM AddtoTree(HTREEITEM hParent, HTREEITEM hInsertAfter, LPTSTR pszData, UINT mask, IUnknown * theInterface); CMClientDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CMClientDlg) enum { IDD = IDD_MCLIENT_DIALOG }; CTreeCtrl m_TreeCtrl; CListCtrl m_Parameters; CString m_strParameter; CString m_strURL; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMClientDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: HICON m_hIcon; // Generated message map functions //{{AFX_MSG(CMClientDlg) virtual BOOL OnInitDialog(); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); afx_msg void OnBrowse(); afx_msg void OnClose(); afx_msg void OnEdit(); afx_msg void OnExecute(); afx_msg void OnDeleteitemListparam(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDeleteitemTree(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnSelchangedTree(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnLoad(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MCLIENTDLG_H__C2D8DBC4_30FE_40DD_848C_78D5834CAD07__INCLUDED_) < resource.h> //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by MClient.rc // #define IDD_MCLIENT_DIALOG 102 #define IDR_MAINFRAME 128 #define IDC_URL 1000 #define IDLOAD 1001 #define IDBROWSE 1002 #define IDC_TREE 1003 #define IDC_LISTPARAM 1004 #define IDC_PARAMETER 1005 #define IDC_EDIT 1006 #define IDC_EXECUTE 1007 #define IDC_CLOSE 1008 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 129 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1009 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif <StdAfx.cpp> // stdafx.cpp : source file that includes just the standard includes // MClient.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" < MClient.cpp> // MClient.cpp : Defines the class behaviors for the application. // #include "stdafx.h" #include "MClient.h" #include "MClientDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMClientApp BEGIN_MESSAGE_MAP(CMClientApp, CWinApp) //{{AFX_MSG_MAP(CMClientApp) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG ON_COMMAND(ID_HELP, CWinApp::OnHelp) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMClientApp construction CMClientApp::CMClientApp() { // TODO: add construction code here, // Place all significant initialization in InitInstance } ///////////////////////////////////////////////////////////////////////////// // The one and only CMClientApp object CMClientApp theApp; ///////////////////////////////////////////////////////////////////////////// // CMClientApp initialization BOOL CMClientApp::InitInstance() { if (FAILED(::CoInitialize(NULL))) { return FALSE; } AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CMClientDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } ::CoUninitialize(); // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; } |
| 出处:CnCode转载收集 作者:不详 |