测试一下

  1. 第一测试图片上传功能

传个瞧瞧

JH

看看有没有图片

  • 再测试粘贴代码功能看看有没有

  • adsadsf

dsaf dsadsadsf

//

// 回调函数声明
typedef int (*PFunc) (int nVal1, int nVal2);

class CA
{
public:
    CA() { }

    virtual ~CA() { }

    /*************************************************************************
    ** 函数说明: 加法计算函数
    ** 参数说明: nVal1 -- 被加数; nVal2 -- 加数
    ** 返回说明: 加法计算的结果
    **************************************************************************/   
    static int    AddFunc(int nVal1, int nVal2)
    {
        int nRet = nVal1 + nVal2;
        return nRet;
    }
    /*************************************************************************
    ** 函数说明: 乘法计算函数
    ** 参数说明: nVal1 -- 被乘数; nVal2 -- 乘数
    ** 返回说明: 乘法计算的结果
    **************************************************************************/   
    static int MultiFunc(int nVal1, int nVal2)
    {
        int nRet = nVal1 * nVal2;
        return nRet;
    }
};

class CB
{
public:
    CB(int nVal1, int nVal2)
    {
        m_nVal1 = nVal1;
        m_nVal2 = nVal2;
    }

    virtual ~CB() { }
    int m_nVal1;                    // 计算值1
    int m_nVal2;                    // 计算值2
    PFunc m_pCallbackFuncAddr;        // 回调函数定义对象
    /*************************************************************************
    ** 函数说明: 加法计算函数
    ** 参数说明: nVal1 -- 被加数; nVal2 -- 加数
    ** 返回说明: 加法计算的结果
    **************************************************************************/
    void Test()
    {
        // 委托执行
        int nRet =    ((PFunc)m_pCallbackFuncAddr)(m_nVal1, m_nVal2);
        // 显示计算结果
        printf("m_nVal1: %d, m_nVal2:%d, nRet:%d/n", m_nVal1, m_nVal2, nRet);
    }
};

/
// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
    int nRetCode = 0;

    // initialize MFC and print and error on failure
    if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
    {
        // TODO: change error code to suit your needs
        cerr << _T("Fatal Error: MFC initialization failed") << endl;
        nRetCode = 1;
    }
    else
    {
        // TODO: code your application's behavior here.
        CA ca;
        CB cb(2, 3);
        cb.m_pCallbackFuncAddr = ca.AddFunc;
        cb.Test();
        cb.m_pCallbackFuncAddr = ca.MultiFunc;
        cb.Test();       
    }

    return nRetCode;
}

 

adsfadsadsadsadsadsadsds

dsfadsadsdsaadsadsadsf

adsfdsadsdsdsdfsdfs

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值