LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using a Windows SDK import library

Hello All,

I have a problem with a program developed on CVI, I used the Windows SDK SetupAPI library to search the devices currently connected to the PC.
I added the import library to the project, the problem is that when I install the application on a PC with Windows XP it works fine, but when I install it on a Windows 2000 PC the application fails at startup and sends an error regarding the kernel32.dll.

I found in the CVI documentation that this could happen when you force an entire library into the executable, so my question is: how can I force only the functions from the import library that I use into the executable? Any help with this will be very appreciated.

Thanks In advance
0 Kudos
Message 1 of 7
(4,530 Views)
If you create a simple .h file which contains the prototype of the function(s) you wish to import, you can use Options->Generate DLL Import Library to produce a .lib file which only references this function from the dll you specify.
 
JR
0 Kudos
Message 2 of 7
(4,489 Views)

Hi everybody.

 

The next links can be useful.

 

http://zone.ni.com/devzone/cda/tut/p/id/3341

 

http://digital.ni.com/public.nsf/websearch/ebce04f31cbb9ace862569290071cb28?OpenDocument

 

Best Regards.

 

Israel B.

AE Mexico.

0 Kudos
Message 3 of 7
(4,477 Views)
Thanks for your suggestions, I already tried doing that, I created my own import library with only the functions used on the application but I still got the same error message.

Do you have any other suggestions??
0 Kudos
Message 4 of 7
(4,414 Views)
It's possible that the SetupAPI library uses kernel32.dll functions which were only added for Windows XP and later builds. Does the text of the error message give any further clues?
 
JR
0 Kudos
Message 5 of 7
(4,405 Views)
The complete error message is this:

The procedure entry point CreateActCtxW could not be located in the dynamic link library KERNEL32.dll.

The thing is, I don't even use that function on the application.

0 Kudos
Message 6 of 7
(4,391 Views)
Microsoft is not even sure about this! Smiley Very Happy  This page says that the function requires XP or Vista, but is not available under XP/2000.Smiley Sad  Looks like you will need to go back to your code and try to find a way to avoid (indirectly) using this function.
 
JR
0 Kudos
Message 7 of 7
(4,376 Views)