Recently I wrote a C ++ program about getlasterror.
Source: Internet
Author: User
Recently, the school curriculum design was written in the C ++ factory model. C ++ does not automatically throw an exception. Therefore, only one hresult (typedef long hresult) can be returned after many items are judged. If the hresult is 0, it is normal. Otherwise, an error code is returned.
This is just a common design, but it brings about huge problems. For example, many things, such as createnode (used to create a linked list), can be returned if a null error is returned. However, this error code cannot be taken out. At this time, we can actually design a public class for returning errors. Code. This is why some functions of Microsoft use hresult to return, and some must use getlasterror.
Since C ++ is rarely written, this course design has failed ...... Close-up ArticleI would like to encourage myself to study and study c ++ in depth this summer.
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.