[導(dǎo)讀]LabVIEW CLN調(diào)用dll時,接口只能是c99的類型,不可以使用c++的string類型。LabVIEW有其定義的string類型: LStrHandle。————————————&mda
LabVIEW CLN調(diào)用dll時,接口只能是c99的類型,不可以使用c++的string類型。LabVIEW有其定義的string類型: LStrHandle。————————————————————————————————————————————————————--------------------------------------------------------------------------------------------C++的code如下:#include"extcode.h"http:// "extcode.h"的路徑是在C:Program FilesNational InstrumentsLabVIEW 2009cintools 里面。如果想用到extcode里面的一些函數(shù),需要鏈接庫labview.libtypedefstruct{int32 len;LStrHandle elm[1];} **LStrArrHd1;extern"C"_declspec(dllexport)voidstrArrayTest(LStrArrHd1 strArray);voidstrArrayTest(LStrArrHd1 strArray){intarraySize = (*strArray)->len;LStrHandle h = (*strArray)->elm[0];intcurStrSize = LStrLen(*h);char*curStr = (char*)LStrBuf(*h);intlen = strlen(curStr);}dll的parameter屬性如下:
——————————————————————————————————————————————Labview具體的string、array類型如下:
例子如下:
本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。