zoukankan      html  css  js  c++  java
  • CLR c++/CLI 如何返回多个返回值

    CLR c++/CLI 如何返回多个返回值

    接口函数定义

    public ref class MWWDianzhuHandle:public ICloneable
    {......

    int scanNewInput(interior_ptr<String ^> sUser, interior_ptr<String ^> sGuest, interior_ptr<String ^> sLastInput, int nStartItemIndex)
    {
    CString strUser, strGuest, strLastInput;

    int res = m_Impl->ScanNewInput(strUser, strGuest, strLastInput, nStartItemIndex);
    *sUser = gcnew String(strUser);
    *sGuest = gcnew String(strGuest);
    *sLastInput = gcnew String(strLastInput);
    return res;
    }

    调用方法

    wwHandle.scanNewInput(ref sUser, ref sGuest, ref sLastInput, 0);

    int scanNewInput(String ^ sUser, String ^ sGuest, String ^ sLastInput, int nStartItemIndex)
    {
    CString strUser, strGuest, strLastInput;

    int res = m_Impl->ScanNewInput(strUser, strGuest, strLastInput, nStartItemIndex);
    sUser = gcnew String(strUser);
    sGuest = gcnew String(strGuest);
    sLastInput = gcnew String(strLastInput);
    return res;
    }

  • 相关阅读:
    预习非数值数据的编码方式
    预习原码补码
    C语言||作业01
    C语言寒假大作战04
    C语言寒假大作战03
    C语言寒假大作战02
    C语言寒假大作战01
    C语言|作业12—学期总结
    C语言|博客作业11
    第三章预习
  • 原文地址:https://www.cnblogs.com/carl2380/p/2642606.html
Copyright © 2011-2022 走看看