04-04-2019 09:48 AM
I have a stand-alone VB6 executable that opens a GUI window for menu navigation, button selection and data reporting/command configuration to devices on an RS-232 or Telnet link. I've been told that LabVIEW can be used to wrap a dll of the code so that it can be run on a Windows 10 system. I've been able to use the Automation Refnum and ActiveX Invoke Node VIs in LabVIEW to access the functions in the DLL, but I've run into the following error:
I've set up my dll and VI according to the instructions in https://forums.ni.com/t5/LabVIEW/How-To-Read-DLL-s-COM-Component-Object-Method-In-Labview-8-6-1/m-p/..., with LabVIEW 2018, 32-bit code as below:
The VB6 application was compiled to have the frmMain form open upon execution. The form is quite complicated, so to simplify the LabVIEW wrapper, I created a VB6 Class Module in the dll with a Multiuse instance, _Lib_Main, that just shows the frmMain form as follows:
Am I right in saying that this class method is inherently non-modal, even though my Open_VB6_Main_Form method is calling a modal form, and my LabVIEW program is running this class method without passing the modality to Form frmMain? (Sorry, I'm not a software expert, so I apologize if I'm not using the exact terminology.) If so, how do I make my program open the VB6 window without completely duplicating the form frmMain in LabVIEW?
Another NI Forum post recommended the methods found at http://resources.esri.com/help/9.3/arcgisdesktop/com/COM/VB6/ModelessVBDialogs.htm for a similar case. I tried updating my local machine registry to set the PreloadVBA key upon running the LabVIEW Run-Time environment, but I couldn't get it to work. I haven't done this before, so I'm not sure I did it the right way. Can anyone show me what's missing in my LabVIEW & VB6 interface?
Solved! Go to Solution.
04-05-2019 09:46 AM
Hi brnbs,
There doesn't seem to be anything inherently missing from your LabVIEW code, so you might have better luck asking this question in a VB forum as well.