首页 > 开发 > 综合 > 正文

webservice系列教学(11)-如何调用webservice(vc2)

2024-07-21 02:21:47
字体:
来源:转载
供稿:网友
<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;
}


收集最实用的网页特效代码!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表