`
- 浏览:
124206 次
- 性别:
- 来自:
广州
-
- <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;
- }
- < MClientDlg.cpp>
- // MClientDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "MClient.h"
- #include "MClientDlg.h"
- #include "Atlbase.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMClientDlg dialog
-
- CMClientDlg::CMClientDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CMClientDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CMClientDlg)
- m_strParameter = _T("");
- m_strURL = _T("");
- //}}AFX_DATA_INIT
- // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- }
-
- void CMClientDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMClientDlg)
- DDX_Control(pDX, IDC_TREE, m_TreeCtrl);
- DDX_Control(pDX, IDC_LISTPARAM, m_Parameters);
- DDX_Text(pDX, IDC_PARAMETER, m_strParameter);
- DDX_Text(pDX, IDC_URL, m_strURL);
- //}}AFX_DATA_MAP
- }
-
- BEGIN_MESSAGE_MAP(CMClientDlg, CDialog)
- //{{AFX_MSG_MAP(CMClientDlg)
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- ON_BN_CLICKED(IDBROWSE, OnBrowse)
- ON_BN_CLICKED(IDC_CLOSE, OnClose)
- ON_BN_CLICKED(IDC_EDIT, OnEdit)
- ON_BN_CLICKED(IDC_EXECUTE, OnExecute)
- ON_NOTIFY(LVN_DELETEITEM, IDC_LISTPARAM, OnDeleteitemListparam)
- ON_NOTIFY(TVN_DELETEITEM, IDC_TREE, OnDeleteitemTree)
- ON_NOTIFY(TVN_SELCHANGED, IDC_TREE, OnSelchangedTree)
- ON_BN_CLICKED(IDLOAD, OnLoad)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CMClientDlg message handlers
-
- BOOL CMClientDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
-
- if (ModifyDialog() == -1)
- return FALSE;
-
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
-
- // TODO: Add extra initialization here
-
- return TRUE; // return TRUE unless you set the focus to a control
- }
-
- // If you add a minimize button to your dialog, you will need the code below
- // to draw the icon. For MFC applications using the document/view model,
- // this is automatically done for you by the framework.
-
- void CMClientDlg::OnPaint()
- {
- if (IsIconic())
- {
- CPaintDC dc(this); // device context for painting
-
- SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
-
- // Center icon in client rectangle
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
-
- // Draw the icon
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
- }
-
- // The system calls this to obtain the cursor to display while the user drags
- // the minimized window.
- HCURSOR CMClientDlg::OnQueryDragIcon()
- {
- return (HCURSOR) m_hIcon;
- }
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////////
- // function: CMClientDlg::OnBrowse()
- //
- // parameters: No Parameters
- //
- // description: selection of wsdl file
- //
- // returns: void
- //
- /////////////////////////////////////////////////////////////////////////////////////////////////////////
- void CMClientDlg::OnBrowse()
- {
- // browse dialog will open and get the selected file
- CFileDialog browse(TRUE, _T("wsdl"), NULL, 0, _T("WSDL Files (*.wsdl)|*.wsdl|All files|*.*||"));
- if (browse.DoModal() == IDOK)
- {
- m_strURL = browse.GetPathName();
- if (m_strURL.IsEmpty())
- return;
- UpdateData(FALSE);
- OnLoad();
- }
-
- return;
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////
- // function: CMClientDlg::OnClose()
- //
- // parameters: No Parameter
- //
- // description: called when dialog is being closed, but before close the dialog, tree should be destroyed.
- // returns: void
- //
- //////////////////////////////////////////////////////////////////////////////////////////////////
- void CMClientDlg::OnClose()
- {
- if (!DestroyTree())
- return;
-
- CMClientDlg::DestroyWindow();
- }
-
- //////////////////////////////////////////////////////////////////////////////////////////////////
- // function: CMClientDlg::OnEdit()
- //
- // parameters: No Parameters
- //
- // description: Edits parameters of the operation
- //
- // returns: void
- //
- //////////////////////////////////////////////////////////////////////////////////////////////////
- void CMClientDlg::OnEdit()
- {
- // get selected row, insert the user input in 3 column of that row
- // assign -1 to the selection mark , so next time user has to select a row to insert data
- int nSelectedRow ;
- LVITEM LVitem;
-
- UpdateData();
-
- if (m_Parameters.GetItemCount() == 0)
- return;
-
- nSelectedRow = m_Parameters.GetSelectionMark();
-
- if (nSelectedRow == -1)
- return;
-
- assignItem (&LVitem, LVIF_TEXT, nSelectedRow, 2, (LPSTR)(LPCTSTR)m_strParameter, ::SysStringLen((LPWSTR)(LPCTSTR)m_strParameter));
-
- if (m_Parameters.SetItem(&LVitem) == 0)
- MSG("Data could not be inserted !");
- cleanup :
- m_strParameter.Empty();
- m_Parameters.SetSelectionMark(-1);
-
- UpdateData(false);
- UpdateData();
-
- return;
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////
- // function: CMClientDlg::OnExecute()
- //
- // parameters: No Parameters
- //
- // description: pressing Execute button calls this function
- // returns: void
- //
- //////////////////////////////////////////////////////////////////////////////////////////////////
- void CMClientDlg::OnExecute()
- {
- UpdateData();
- UpdateData(false);
-
- if (CheckforURL() == -1)
- return;
-
- Execute();
-
- return;
- }
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
详细解析webservice的原理和使用,帮助新手快速上手。
Webservice教学
webservice摘录webservice摘录webservice摘录webservice摘录webservice摘录webservice摘录webservice摘录webservice摘录webservice摘录质
Java_WebService开发系列.ppt ,希望有帮助
ASP.NET & WebService教学ppt(上),非常实用!
springboot+webservice搭建webservice服务端及使用java客户端两种方式进行调用
webservice的入门概念及java的开发webservice框架
WebService是一个新概念,它的系统架构、实现技术是现有应用的面向Internet的一个延伸。Web是为了程序到用户的交互,而Web Service是为程序到程序的交互作准备,Web Service已成为IT产业近几年来探索的热点课题之一...
webservice4 二进制文件读取 webservice4 二进制文件读取
webService 开发
[尚硅谷]_张晓飞_Webservice教学课件
测试webService;webservice测试调用工具WebserviceStudio20
WebService练习WebService练习WebService练习WebService练习
webservice视频教学,里面包括了源代码和视频文件,
调用WebService,最简单的办法当然是直接添加WEB引用,然后自动产生代理类,但是在调用JAVA的WebService时并没有这么简单,特别是对于SoapHeader的处理,通过C#添加Web引用方式访问JavaWebService的方法,除了string...
通过idea实现webservice
springboot+webservice搭建webservice服务端及使用java客户端两种方式进行调用webservice接口