When using MFC to operate Windows Service, encoding problems are encountered.

Source: Internet
Author: User

# Include "stdafx. H"
# Include <winsvc. h>

 

The above two rowsCodeThe order is not interchangeable. Because of my carelessness, I want to put the <> above, so that the code looks pleasing to the eye, and the result is 2.5 hours delayed.

After interchange, a lot of inexplicable errors are reported due to incorrect Code call relationships, but the issue of which. cpp file is located can be located.

 

I searched for msdn, Google, and Baidu, but few of them showed evidence of how to solve them. It seems that an mvp on the msdn Forum gave the correct answer and couldn't remember it, but he seemed very lazy, just saying that he guessed it was the case.

Even more cool, some forums, even say that winver and so on, are really getting farther and farther away, and can get people killed.

 

In any case, I found the real reason, because it was a beginner who wrote an article to help others.

Technorati label: winsvc. h
Related Article

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.