丁香美女社区,国产午夜av秒播在线观看,老八日三个媳妇的最新进展,国产一区二区波多野结衣,国产又黄又爽又猛免费视频播放

咖迷社區(CAXA數碼大方)

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

查看: 6588|回復: 0
打印 上一主題 下一主題

CAXA工藝圖表2011二次開發

[復制鏈接]

1

主題

1

帖子

64

積分

注冊會員

Rank: 2

積分
64
跳轉到指定樓層
樓主
發表于 2020-5-4 20:43:51 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
我在對CAXA工藝圖表2011進行二次開發,參考你之前貼子中的代碼:        HRESULT hRet;
        CLSID clsid;
        ICAPPInfo *pInterface = NULL;
        ICAPPXmlInfo *pXmlInterface = NULL;
        hRet = ::CLSIDFromProgID(L"CAXAInfo.CAPPInfo", &clsid);
        if (FAILED(hRet))
                return;
        hRet = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, __uuidof(ICAPPInfo), (void **)&pInterface);
        if (FAILED(hRet));
    LPDISPATCH lpDisp=NULL;
        COleVariant covOptional((long)DISP_E_PARAMNOTFOUND,VT_ERROR);   
        CString CappFileName = L"E:\\30DevSupport\\55CAXA\\ObjectCRX_Samples\\model\\test.CXP";
        CString TxtXmlFileName= L"test.txt";
        CString filePassword= L"";
        CString cardName=L"模殼-工藝過程卡";
        CString colName = L"工序內容";
        CString sTemp=colName+L"^"+L"HFHZ";
        CString sExtFilter = L"txt";
        VARIANT_BOOL ret;
        BSTR BstrEbFileName,BstrTxtXmlFileName,bstrpassword,bstrColInfo,bstrCardName;
        int iCardMask = 1|2|4|8|16;

        BstrEbFileName=CappFileName.AllocSysString();
        BstrTxtXmlFileName=TxtXmlFileName.AllocSysString();
        bstrpassword= filePassword.AllocSysString();
        bstrColInfo = sTemp.AllocSysString();
        bstrCardName = cardName.AllocSysString();
        //hRet = pInterface->raw_GetCappInfoToTxt(BstrEbFileName,BstrTxtXmlFileName,&ret);
        BSTR strCommonAtt;
        //hRet = pInterface->raw_GetCardCommonAttrib(BstrEbFileName,&strCommonAtt,&ret);
        if(sExtFilter == "xml")
        {
          pXmlInterface =(ICAPPXmlInfo*) pInterface;
          BSTR strTemplateSetName;
          hRet = pXmlInterface->raw_GetTemplateSetNameForCxpFile(BstrEbFileName,&strTemplateSetName);
          hRet=pXmlInterface->raw_InfoToXmlFile(BstrEbFileName,iCardMask,BstrTxtXmlFileName,&ret);
          pXmlInterface = NULL;
        }
        else
        {
          pXmlInterface =(ICAPPXmlInfo*) pInterface;
          BSTR strTemplateSetName;
          hRet = pXmlInterface->raw_GetTemplateSetNameForCxpFile(BstrEbFileName,&strTemplateSetName);
          //hRet=pXmlInterface->raw_InfoToTxtFile(BstrEbFileName,BstrTxtXmlFileName,&ret);
          hRet=pXmlInterface->raw_OpenFile(BstrEbFileName,bstrpassword);

          hRet = pXmlInterface->raw_WriteTxtInfoToCard(bstrCardName,bstrColInfo,5,&ret);
          hRet=pXmlInterface->raw_CloseFile();
          pXmlInterface = NULL;
        }
        //hRet = pInterface->raw_GetCappInfoToTxt(BstrEbFileName,BstrTxtXmlFileName,&ret);

        if(FAILED(hRet))
        {
          ::SysFreeString(BstrEbFileName);
          ::SysFreeString(BstrTxtXmlFileName);
          //HandError(pInterface,IID_ICAPPInfo);
          pInterface->Release();
          return;
        }
        ::SysFreeString(BstrEbFileName);
        ::SysFreeString(BstrTxtXmlFileName);

        pInterface->Release();
但是調試發現raw_InfoToTxtFile和raw_OpenFile始終返回S_FALSE,同時功能也沒有實現。請教一下是怎么回事?不勝感激!
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|咖迷社區(CAXA數碼大方) ( )

GMT+8, 2025-11-7 04:25 , Processed in 0.125860 second(s), 19 queries .

Powered by X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回復 返回頂部 返回列表