rt,最后有简单的代码

解决方案 »

  1.   

    http://dev.csdn.net/article/44/44820.shtmhttp://www.zahui.com/html/1/2750.htm
      

  2.   

    SAFEARRAYBOUND sab;
    sab.cElements = 2;
    sab.lLbound = 0;
    SAFEARRAY *pas = SafeArrayCreate(VT_VARIANT,1,&sab);         
             VARIANT bb,ss;
    bb.vt = VT_BSTR;
    bb.bstrVal = (BSTR)_T("--sout");
    if (FAILED(SafeArrayPutElement(pas,&i,&bb)))
    AfxMessageBox("Failed Put");
    if (FAILED(SafeArrayGetElement(pas,&i,&ss)))
    AfxMessageBox("Failed Get");
    AfxMessageBox((char *)bb.bstrVal);
    AfxMessageBox((char *)ss.bstrVal);
    最后ss.bstrVal不对,类型是VT_EMPTY
    是不是BSTR的用法不对
    用VT_I4就没错
      

  3.   

    bb.bstrVal = CString("--sout").AllocSysString();