LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What causes inconsistent error: Error loading "mydll.dll" Invalid access to memory location.

I have a set of sample code vis which are wrappers around an external dll using the call library function nodes.  These work in all versions of LabVIEW from 6.1 to 8.2.  In version 8 and 8.2, there is an inconsistent error which appears after a vi is opened, run successfully, closed and then re-opened some time later - all without closing LabVIEW.  The error is reported without an error number as 'Error loading "myDll.dll". Invalid access to memory location.'  If LabVIEW is closed, reopened and the vi loaded again and run, it works fine.  The same error occurs if a second vi calling the same .dll is loaded and run after the first is successful.
 
Since the vi works just fine the first time it is opened, why does this error occur the second time?  What do I have to change so that I don't  have to close LabVIEW every time I want to run a different VI?
 
Thanks in advance.
 
Mike.
 
 
0 Kudos
Message 1 of 2
(3,289 Views)

Mea culpa. We have found a fix for this.  It relates to our dll structure.  We create a message pump in the dll associated with a hidden window.  When the dll is initialized, the window is registered with the operating system.  When the dll is unloaded, the window is closed but we weren't de-registering it.  This caused the problem the second time the dll was loaded.  By de-registering when the dll is unloaded, the problem has been solved.

Mike.

0 Kudos
Message 2 of 2
(3,278 Views)