LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use "LabVIEW dll import wizard" to import NETAPI32.dll

I am trying to use the LabVIEW dll import wizard for the first time. I am not very familiar in C-coding so this might be a good help instead of configuring CallLibraryFunction nodes myself.

 

I want to import NETAPI.dll. I am interested in several functions in that dll, but my main priority is the funtion NetUserGetInfo(). On MSDN I have found that the header file for the mentioned function should be: lmaccess.h (include lm.h).

 

My problem is this: Smiley Sad

The shared library contains 317 function(s). But no function is found and recognized in the header file. The following function(s) cannot be wrapped. If you want to import these functions, please review the warning messages next to the functions below. You will need to fix the problems before you can continue with the wizard.

 

The function cannot be imported into LabVIEW. This might be caused by one of the following problems:

The function is not declared in the header file but is exported in the library.

Check the header file to make sure it contains declarations of the function.

Undefined symbols can prevent the wizard from recognizing functions and parameters. To correct this problem, check the header file to determine if you must add predefined symbols. Click the Back button to return to the previous page of the wizard to add a predefined symbol (for example, "NIAPI_stdcall = __stdcall" or "NIAPIDefined = 1").
MIDL_PASS;_STDCALL_SUPPORTED;__cplusplus;

 

 

Any suggestions how I can solve my issue?   

0 Kudos
Message 1 of 8
(4,418 Views)
What is your lv version?
0 Kudos
Message 2 of 8
(4,413 Views)
see whether this will help
0 Kudos
Message 3 of 8
(4,405 Views)
LabVIEW 8.5.1.
0 Kudos
Message 4 of 8
(4,400 Views)

astrid wrote:

I am trying to use the LabVIEW dll import wizard for the first time. I am not very familiar in C-coding so this might be a good help instead of configuring CallLibraryFunction nodes myself.

 

I want to import NETAPI.dll. I am interested in several functions in that dll, but my main priority is the funtion NetUserGetInfo(). On MSDN I have found that the header file for the mentioned function should be: lmaccess.h (include lm.h).

 

My problem is this: Smiley Sad

The shared library contains 317 function(s). But no function is found and recognized in the header file. The following function(s) cannot be wrapped. If you want to import these functions, please review the warning messages next to the functions below. You will need to fix the problems before you can continue with the wizard.

 

The function cannot be imported into LabVIEW. This might be caused by one of the following problems:

The function is not declared in the header file but is exported in the library.

Check the header file to make sure it contains declarations of the function.

Undefined symbols can prevent the wizard from recognizing functions and parameters. To correct this problem, check the header file to determine if you must add predefined symbols. Click the Back button to return to the previous page of the wizard to add a predefined symbol (for example, "NIAPI_stdcall = __stdcall" or "NIAPIDefined = 1").
MIDL_PASS;_STDCALL_SUPPORTED;__cplusplus;

 

 

Any suggestions how I can solve my issue?   


Sorry I forgot the attachment, but here it is.

0 Kudos
Message 5 of 8
(4,388 Views)
You cannot use the call library function node or the import wizard with a .NET dll. You have to use the functions on the Connectivity>.NET palette.
0 Kudos
Message 6 of 8
(4,381 Views)
I know it is related to Network Management Functions, but not if it is a .NET function. How do I know if it is a .NET function ?
0 Kudos
Message 7 of 8
(4,377 Views)

It's not a .NET assembly, so the Call Library Function Node is the correct function to use.

 

It's pointless to import the entire DLL for just one function. Besides, there are so many dependencies in header files with Windows API functions that it's a nightmare to try to figure out which header files you need and which symbols need to be defined. You're better off just figuring out the function you want to call.

 

That function is not well suited for use in LabVIEW. The buffer that gets created is allocated by the function itself, which means you need another CLFN to call the NetApiBufferFree function to deallocate the buffer - otherwise you have a memory leak. Also, the size and meaning of the buffer varies depending on the value of the "level" parameter.  What information are you trying to get? There may be an easier way to do it. 

0 Kudos
Message 8 of 8
(4,357 Views)