Hi,
Perhaps you use references to windows in LabVIEW. If you get those
references with a full path (e.g. c:\code\subvis\vi1.vi), this will work
while in LabVIEW environment. But when an application is build, this will
fail, because the vi is no longer there. Try using the name in a string
instead (the OpenVIReference is polymorphic) with only the name of the vi in
it (e.g. vi1.vi).
There are some other isues that change when building an application. Most of
them are paths that change, and references that fail to open because of
them.
Regards,
Wiebe.
"cpuwzd" wrote in message
news:506500000008000000DAA20000-1042324653000@exchange.ni.com...
> I have created a large application that is split between VB 6 and LV
> 6.1. The LabVIEW portion runs in the background, except that the VB
> portion can request that a LabVIEW user interface be presented on
> demand. Any time after this LabVIEW user interface has been opened
> and closed, opening and closing another application (or even just
> hiding a top-level window in another application) will cause LabVIEW
> to close, taking my background processing with it.
>
> If the LabVIEW code is running as source code, LabVIEW prompts me
> before closing. However, when the LabVIEW code is running as an
> executable (.exe), the executable closes without prompting in this
> circumstance.
>
> The scenario can be reproduced with a standard LabVIEW sample program.
> Proceed as follows:
>
> 1) Open VBToLV.vbp (the example program distributed with LabVIEW 6.1).
> 2) Start the VB program running.
> 3) Press the Launch LabVIEW button on the user interface of the VB
> program.
> 4) Enter an expression in the text box provided.
> 5) Select Display VI Front Panel.
> 6) Press the Run VI button.
> 7) Close the VI front panel by clicking its "X" button.
> 😎 Open any handy application, such as Windows Explorer or Notepad.
> 9) Close this most-recently-opened program.
> 10) The LabVIEW Exit screen appears.
> 11) Exit LabVIEW.
> 12) Press the Run VI button.
> 13) An error occurs because LabVIEW has closed.
>
> If the LabVIEW code had been built into an executable and called
> accordingly, there would have been no LabVIEW exit screen. The
> executable would have just exited silently.
>
> This is not the way a COM server is supposed to behave. The VB
> program is still holding a valid reference to the server and it should
> remain open.
>
> It appears that LabVIEW is monitoring the total number of top-level
> windows that are open. I suppose that this is how LabVIEW figures out
> when its own FP windows have been closed. In this case, it doesn't
> notice that all of its windows have been closed until some other
> window closes.
>
> I have a work-around, but it's ugly.
>
> Ron Martin
> Balance Technology Inc.