LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView VB6 Dll Interfacing causes memory leak

Solved!
Go to solution

I added this code to the general part of the code: 

 

Private Declare Function DSDisposeHandle Lib "lvrt.dll" (LStrHandle as Long) as Integer

And after I copy the the data in VB I added this code:

Dim dispose as Integer
dispose = DSDisposeHandle(StringHandle_detector)
dispose = DSDisposeHandle(StringHandle_ext)

but nothing has changed. Have I missed something here? 

 

 

If I want to create a Pointer to a C string instead - how do I do this in vb6? 

 

Best,

 

Julian

 

edit:

 

As pointers have to be adressed ByVal I changed the line to :

Dim dispose as Integer
dispose = DSDisposeHandle(ByVal StringHandle_detector)
dispose = DSDisposeHandle(ByVal StringHandle_ext)

Which did the trick 🙂

 

Thanks very much!!

0 Kudos
Message 11 of 13
(1,122 Views)

@jschmidtengler wrote:

 

As pointers have to be adressed ByVal I changed the line to :

Dim dispose as Integer
dispose = DSDisposeHandle(ByVal StringHandle_detector)
dispose = DSDisposeHandle(ByVal StringHandle_ext)

Which did the trick 🙂

 


My VB knowledge is almost non existent but wouldn't

 

Private Declare Function DSDisposeHandle Lib "lvrt.dll" (ByVal LStrHandle as Long) as Integer

do the same?

Rolf Kalbermatter
My Blog
0 Kudos
Message 12 of 13
(1,106 Views)

Yes.

 

The latter would also be the more elegant way of implementing it - directly in the definition.

 

Best,

 

Julian

0 Kudos
Message 13 of 13
(1,101 Views)