LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

MAKEINTRESOURCE declared in winuser.h and differently in winver.h

I am getting errors when I try to compile. MAKEINTRESOURCEA and MAKEINTRESOURCEW are declared with a ULONG_PTR as a parameter in winuser.h and as a DWORD in winver.h; Thus a conflict. What am I doing wrong?
0 Kudos
Message 1 of 5
(4,617 Views)
Hi jmoquin,

My copy of C:\Program Files\National Instruments\CVI85\sdk\include\winver.h doesn't define MAKEINTRESOURCEA or MAKEINTRESOURCEW. Where are you including winver.h from?

Luis
0 Kudos
Message 2 of 5
(4,588 Views)

Thanks Luis,

Somehow a winver.h dated 1996 ended up in my nationalinstruments/cvi85/bin folder and that had the redeclaration for MAKEINTRESOURCE. It's under the heading of stuff for winuser.h for RT_Version. I replaced the winver.h file with a newer one and no more complaints.

-John

0 Kudos
Message 3 of 5
(4,563 Views)
I have had this problem when I include something in: National Instruments\CVI85\bin.
When a header file references winver.h it finds the one in National Instruments\CVI85\bin beause now the directoy is in the project path settings. 
 
Is there a reason there are two different copies of winver.h?
 
Thanks,
Garth
0 Kudos
Message 4 of 5
(4,531 Views)
Garth, John:
 
You guys are absolutely right. I did find a winver.h in the .\bin folder, which really surprised me. I did some digging into ancient CVI history and came to the conclusion that the most likely reason for its presence is to allow .\bin\modreg.c to be built. At the time that modreg.c was created, the version of winver.h that was present in the .\sdk\include folder was probably too old to support some of the datatypes (DWORD?) that modreg.c used. Later on, the sdk headers were upddated, but even though it was no longer needed, that special version of winver.h was left in .\bin, probably as an oversight.
 
The purpose of modreg.exe was to allow 3rd party installers to register libraries with the CVI environment. It's not completely clear to me why the source file (but no the makefile) for that program was ever installed with CVI. Maybe some CVI users wanted to customize its behavior. Based on this issue that you brought, we are going to review whether this source file really needs to be installed, and in all likelihood we'll remove it, and winver.h from the .\bin folder.
 
In the meanwhile, you can go ahead and remove .\bin\winver.h from your CVI installation. I'm confident that it's not needed, and at least you should no longer have the problem of it conflicting with the other sdk headers.
 
Luis
0 Kudos
Message 5 of 5
(4,516 Views)