LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Documentation on PostLVUserEvent() function

Solved!
Go to solution

Hello,

 

We are developing an application where we have some C code in a .dll that has callbacks in the functions.  We have seen examples of code that uses the PostLVUserEvent() function along with other functions that do memory allocation, DSNewHandle().  Is there any more recent documentation on these functions (all I have is something dated April 2003 called Using External Code in LabVIEW)?  Also, does the code in the .dll have to manage the memory?  Does it have to deallocate the memory created with the DSNewHandle() function between each call, or would one normally allocate the space at the beginning of the program and then deallocate it with the DSDisposeHandle()?

 

Thanks,

Bob

Message 1 of 2
(4,212 Views)
Solution
Accepted by topic author BobDescham

Hi BobDescham,

 

It took some digging, but I found a bit more documentation for the two functions that you’d mentioned. I found this article- http://digital.ni.com/public.nsf/allkb/89165EDE5031C68686257B2E0006FE99- which discusses using callbacks in C, specifically mentions PostLVUserEvent(), and talks some about how it’s used. There’s also the help page for the function: http://zone.ni.com/reference/en-XX/help/371361M-01/lvexcode/postlvuserevent/.

 

DSNewHandle() is used to allocate memory, here’s its help page: http://zone.ni.com/reference/en-XX/help/371361M-01/lvexcode/aznewhandle_dsnewhandle/, and here’s a more in-depth article that talks about memory handling, and the functions involved: http://zone.ni.com/reference/en-XX/help/371361M-01/lvexcodeconcepts/memory_manager/.  

 

Kathryn K.

Applications Engineer

National Instruments

http://ni.com/support

Kathryn K.
Technical Support Engineer
National Instruments
http://ni.com/support
Message 2 of 2
(4,168 Views)