Programming windows: Debug sysmets1.c

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.