Jump to content

Calling external DLL fails


Recommended Posts

I am trying to use an external DLL with LV.

This DLL is known to work with VB and C++; however, when I call it LV traps a low level memory corruption error and stops the VI.

What might be the problem - or what am I doing wrong?

Gyc

Link to comment
I tried to pass the string as "handle" and as "handle pointer" but it doesn't work: LV is just kicked out with absolutely no messages.

Thanks anyway!

Gyc

5239[/snapback]

That's because the DLL does NOT expect a LabVIEW handle or even a pointer to such. Instead it expects a pointer to a C string.

char somevar[]

is equivalent to

char *somevar

as far as the C compiler is concerned. This is definitely a C string pointer. Configure the Call Library Node parameter accordingly and you should be fine. A LabVIEW string handle or pointer to such can only ever be used for DLLs which have been explicitedly developed to be called by LabVIEW.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.