From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Win32 API calling by Code Interface Node

Hi all,

I wish to call a Win32 API function by using the code interface node.
However, I don't know the data types in LabVIEW corresponding to the "HANDLE
*" in Visual C++.

Here's the function I wish to call:

BOOL bOpenDriver (HANDLE * phDeviceHandle, PCHAR devname) {
*phDeviceHandle = CreateFile(devname,
GENERIC_WRITE,
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);

if (*phDeviceHandle == INVALID_HANDLE_VALUE) {
return (FALSE);
} else {
return (TRUE);
}

}

Thank you in advance.
JJ


0 Kudos
Message 1 of 2
(2,189 Views)

If this is really a Windows API function, then the handle can most likely be treated as an I32.

Note that you can't actually do anything with the handle other than passing it to other functions.

If you search this site for "LabVIEW" and "DLL" you should find some resources about working with DLLs and Win32 API DLLs.


___________________
Try to take over the world!
0 Kudos
Message 2 of 2
(2,187 Views)