rkgghz
rkgghz

Reputation: 455

LabView doesn't unload dll when called in development environment

I have a LabView application that uses an external C DLL. When I run my application in the development environment, the DLL is blocked even after the the app is closed.

When I want to overwrite or delete the DLL, I have to first close LabView completely.

Is this a known issue? Can anyone offer a solution for this problem?

Upvotes: 0

Views: 1320

Answers (1)

Joe Friedrichsen
Joe Friedrichsen

Reputation: 1986

Yes, you must do two things in your LabVIEW application:

  1. Specify the path to the library on the block diagram rather than in the configuration dialog (which changes LabVIEW's behavior from load-time linking to run-time linking).
  2. When you're done using the DLL node, wire a null path to tell LabVIEW that you're done using it (which causes Windows' reference count to decrement to 0 and the OS will unlock the file).

More details here: Can I Dynamically Load and Unload a DLL in LabVIEW?

Upvotes: 4

Related Questions