The editor is VC ++ 6.0.
Create a Win32 Application
The following error occurs during compilation:
-------------------- Configuration: sysmets1-Win32 debug --------------------
Compiling...
Sysmets1.c
E:/test/sysmets1/sysmets. H (297): Error c2065: 'sm _ mousewheelpresent ': Undeclared identifier
E:/test/sysmets1/sysmets. H (297): Error c2099: initializer is not a constant
E:/test/sysmets1/sysmets. H (297): Warning c4047: 'initializing': 'int' differs in levels of indirection from 'Char [21]'
E:/test/sysmets1/sysmets. H (301): Error c2065: 'sm _ xvirtualscreen ': Undeclared identifier
E:/test/sysmets1/sysmets. H (301): Error c2099: initializer is not a constant
E:/test/sysmets1/sysmets. H (303): Warning c4047: 'initializing': 'int' differs in levels of indirection from 'Char [24]'
E:/test/sysmets1/sysmets. H (305): Error c2065: 'sm _ yvirtualscreen ': Undeclared identifier
E:/test/sysmets1/sysmets. H (305): Error c2099: initializer is not a constant
E:/test/sysmets1/sysmets. H (309): Error c2065: 'sm _ cxvirtualscreen ': Undeclared identifier
E:/test/sysmets1/sysmets. H (309): Error c2099: initializer is not a constant
E:/test/sysmets1/sysmets. H (309): Warning c4047: 'initializing': 'int' differs in levels of indirection from 'Char [19]'
E:/test/sysmets1/sysmets. H (313): Error c2065: 'sm _ cyvirtualscreen ': Undeclared identifier
E:/test/sysmets1/sysmets. H (313): Error c2099: initializer is not a constant
E:/test/sysmets1/sysmets. H (315): Warning c4047: 'initializing': 'int' differs in levels of indirection from 'Char [22]'
E:/test/sysmets1/sysmets. H (317): Error c2065: 'sm _ cmonitors ': Undeclared identifier
E:/test/sysmets1/sysmets. H (317): Error c2099: initializer is not a constant
E:/test/sysmets1/sysmets. H (321): Error c2065: 'sm _ samedisplayformat': Undeclared identifier
E:/test/sysmets1/sysmets. H (321): Error c2099: initializer is not a constant
E:/test/sysmets1/sysmets. H (321): Warning c4047: 'initializing': 'int' differs in levels of indirection from 'Char [21]'
Error executing cl.exe.
Sysmets1.obj-14 error (s), 5 Warning (s)
Solution:
Constants that can be used only in the IRK.
Add a sentence at the beginning of the sysmets. cpp file.
# Define winver 0x0500
There is another error.
Getsystemmetrics (sysmetrics [I]. iindex)
Change
Getsystemmetrics (sysmetrics [I]. Index)
The following is a comparison table:
| Minimum system required |
Macros to define |
Windows 95 and
Windows NT 4.0 |
Winver = 0x0400 |
Windows 98 and
Windows NT 4.0 |
_ Win32_windows = 0x0410 and winver = 0x0400 |
| Windows NT 4.0 |
_ Win32_winnt = 0x0400 and winver = 0x0400 |
| Windows 98 |
_ Win32_windows = 0x0410 |
| Windows 2000 |
_ Win32_winnt = 0x0500 and winver = 0x0500 |
| Windows ME |
_ Win32_windows = 0x049 |