SelectThreadIdealProcessor

I use the LW/CVI FDS 7.0.  I have a programme of work to acquire data at the same time a data acquisition card and two serial devices. I now need to add another sensor that acts as a TCP/IP server.  I have worked successfully with the new sensor that communicates via TCP/IP using a test program. In my data acquisition program, I will acquire new data the main thread sensor because it is intensive reminder for TCP/IP communications and use a second thread for the existing DAQ card and two serial ports.  If the program is unable to obtain the data fast enough, I want to assign the second thread for the second processor on the computer. The white paper NOR 'Multithreading in LabWindows/CVI' says setting the preferred processor for a thread using the 'SetThreadIdealProcesssor' Win32 API function LW/CVI will automatically search the SDK Windows/for unresolved references after searching for the libraries of LW. When I try to compile the exe, I get an error in 'Unresolved Reference' linker for the function "SetThreadIdealProcesssor".  By examining the NEITHER provided the files 'sdkfuncs.txt' and 'sdkfuncs_base.txt', no reference to the "SetThreadIdealProcesssor" is located. I found the function prototype in the file "winbase.h. I was unable to find "SetThreadIdealProcesssor" in any file where LW/CVI is installed with the exception of a .pdf on multithreading file and the file "winbase.h.

Is or is not the "SetThreadIdealProcesssor" included with LW/CVI FDS 7.0?  If Yes, where and how I reference to bind.  I have add "windows.h" and "winbase.h" as include files to try to resolve the problem without success.

I saw a forum a few years ago, but there was no resolution.

Are you sure that it is a mistake to link that you see and not a compilation error? The problem I see is that the function in winbase.h prototype has a guard preprocessor around it (probably because that feature was added only in Windows 2000). These guardians of preprocessor to protect against using the use inadvertently a function does not much sense, since what matters is the version of the operating system when you run your program, not the version with which you compile.

In all cases, you should be able to work around this problem by adding the following to the top of your source code (before include windows.h):

#define _WIN32_WINNT 0 x 0500

After that, you should get is no longer a link error. Let me know if this isn't the case.

Moreover, the implementatin function is in C:\Program NIUninstaller Instruments\CVI70\sdk\lib\msvc\kernel32.lib. You don't have to add this library to the project.

Luis

Tags: NI Software

Similar Questions

Maybe you are looking for