LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Import shared library(dll)

Salut.
 
I want to import the GetVolumeInformationW function from the Windows kernel32.dll.
 
Microsoft says:
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Server Requires Windows Server "Longhorn", Windows Server 2003, Windows 2000 Server, or Windows NT Server.
Header

Declared in Winbase.h; include Windows.h.

Library

Use Kernel32.lib.

DLL Requires Kernel32.dll.
Unicode

Implemented as GetVolumeInformationW (Unicode) and GetVolumeInformationA (ANSI). Note that Unicode support on Windows Me/98/95 requires Microsoft Layer for Unicode.

 
1- I start the wizard, select "Create VIs for a shared library" then click next
2- Then select C:\WINDOWS\system32\kernel32.dll for the shared library.
3- Then select C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\WinBase.h for the header file
4- Click next
5- Add C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include to the include path (for Windows.h)
6- Click next...wait
7- Then NI says :
The shared library contains 949 function(s), among which the declarations of 0 function(s) are found in the header file and these function(s) will be imported. The remaining 949 function(s) listed below cannot be imported.
 
How can i make it work? Is it possible?
0 Kudos
Message 1 of 2
(3,002 Views)
Hello,

I just downloaded the SDK and attempted the same operations you described, with identical results.  I suspect that the problem is that the WinBase.h header depends on predefined symbols that are not present by default in our implementation of the DLL importer.  I haven't spent enough time examining the code to tell you precisely what these symbols would need to be, but that is where I would focus my efforts.  According to Microsoft, you may want to try defining NTDDI_VERSION, as per this document.
Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 2 of 2
(2,973 Views)