LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

compiler error for INLINE HANDLE

Using WinRT include file get compiler error:
WINRT_INLINE Found identifier HANDLE expected ";"
Code was developed on Windows NT and recently ported
to Windows 2000.
0 Kudos
Message 1 of 5
(3,188 Views)
Hi,

I'm not familiar witht he WinRT include file that you are talking about. I know that for some cases in the Windows SDK you need to define certain macros in order for some parts to compile, i.e. is you want to use a waitable taimer from the Windows SDK you need to dfefine the version of Windows before including Windows.h otherwise you get a bunch of compiler errors.

Check the h file where the error occurs, see if there are any #ifdef statesments that need to certain preconditions to compile correclty. finally you can use CVIs option to pre-compile the file. This will replace the #includes and the #ifdef's and macros with the actuall code. this can help you narrow down the error. Just open the C file and select "Preprocess Source File" from the options m
enu.

I hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 5
(3,188 Views)
Hello Juan Carlos,
Thanks! Will try what you suggest. The include file is WinRTctl.h and Measurement Studio 6.0 shows the same compiler error for these 4 inline functions:
WINRT_INLINE HANDLE WinRTCreateEvent(etc...
WINRT_INLINE HANDLE WinRTCreateEventVxD(
WINRT_INLINE HANDLE WinRTOpenNamedDevice(
WINRT_INLINE HANDLE WinRTOpenDevice(

WinRTctl.h has #define WINRT_INLINE __inline and
the error is:
WinRTctl.h syntax error; Found 'identifier' expecting ';'.
0 Kudos
Message 3 of 5
(3,188 Views)
Hi,

I think we may be able to obtain more information if you preprocess the c file to get rid of all the macros that make things had to read. Just open up the c file in the IDE select "Preprocess Source File" from the Options menu and and try to compile the file again. Wiht out any macros it is possible to detect where the root cause of the error is.

Another thing is that you may want to ask "BlueWater Systems" (authors of the file) if that h file was created to be used in a C environment; it's possible that it was meant for C++ usage and that they have a separate version for c compilers.

let me know how this goes.

regards,

Juan Carlos
0 Kudos
Message 4 of 5
(3,188 Views)
Hello Juan Carlos,
Scott had ported the code to Windows 2000 and he
fixed the problem very simply by commenting out:
/*WINRT_INLINE*/ HANDLE WinRTCreateEvent(etc...
/*WINRT_INLINE*/ HANDLE WinRTCreateEventVxD(
/*WINRT_INLINE*/ HANDLE WinRTOpenNamedDevice(
/*WINRT_INLINE*/ HANDLE WinRTOpenDevice(

For some unknown reason our MS Visual C/C++ dislikes:
#define WINRT_INLINE __inline

Thanks again for your help.
0 Kudos
Message 5 of 5
(3,188 Views)