From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



從Visual Basic通過ActiveX來呼叫LabVIEW程式



主要軟體: LabVIEW Development Systems
主要軟體版本: N/A
主要軟體修正版本: N/A
次要軟體: N/A

問題: 我如何把LabVIEW設為一個ActiveX Server, 而讓VB可以呼叫它

解答: 1. 使用Application Builder來製造執行檔時, 請啟動在App Setting裡的Enable ActiveX server

2. 手動的把您的程式註冊為ActiveX server. 只要執行程式加上/RegServer指令即可. 例如, 執行:


MyApp.exe /RegServer


這樣就可做一個.tlb檔出來. 想了解更多關於註冊程式, 可參考下面的文件連結. 連結內是關於TestStand, 不過LabVIEW也是一樣的.

3. 在您的Visual Basic project裡, 選References -> Browse選擇之前所建立的.tlb檔跟程式執行檔.

請參考附加檔案來學習如何呼叫您的程式. 您也可以參考在labview\examples\comm裡的VBToLV.frm, VBToLV.vbp, 以及VBToLV.vbw

相關連結: KnowledgeBase 1HBAMMSR: How Do I Manually Register ActiveX Automation Servers?

附加檔案:


Counter.zip - Counter.zip


報告日期: 12/10/1999
最後更新: 01/05/2005
文件偏號: 1S95EK2O