Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Additional Windows Examples of LabVIEW Calls to DLLs

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

(Windows) The following examples can help you learn more about calling DLLs from LabVIEW:

  • The Call DLL VI located in labview\examples\dll\data passing\Call Native Code.llb allows you to browse examples of C and C++ external code data types and how they interface with LabVIEW.   
  • The Sound Player VI located in the labview\examples\sound2\sound2.llb directory lets you play Windows .WAV sound files on your computer from LabVIEW, if you have a sound card with Windows sound drivers installed on your system.   
  • If you do not have a sound, card you can generate a sound in your PC speaker by calling the MessageBeep function in User32.DLL. The function prototype is as follows:

VOID MessageBeep(UINT uType);

  • The Hostname VI located in the labview\examples\dll\hostname directory returns the host name of your computer, demonstrating how to use LabVIEW string handles.    
  • You can programmatically position your cursor anywhere on your monitor using the SetCursorPos function in User32.DLL. The function prototype is as follows:

BOOL SetCursorPos(INT x, INT y);

x and y are the coordinates you want, referenced from the upper left corner of the screen. The return value is TRUE if the function was successful and FALSE if it was unsuccessful. Remember that the value returned is type BOOL, which is defined in the Win32 API as a 32-bit signed integer with values 0 = FALSE and 1 = TRUE.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit