CodePudding user response:
Tested, no problem, the console added, MFC didn't try,CodePudding user response:
Small see...CodePudding user response:
Strange, I also is this kind of situation! But as the ABCD, there is no problem.CodePudding user response:
# import can optionally include one or more attributes. These attributes tell the compiler to modify the contents of the type - library headers. A backslash (\) symbol can be 2 include additional lines in A single # import statement. For example:# import "test. The lib" no_namespace \
Rename (" OldName ", "NewName")
.
The rename attribute
Rename (" OldName ", "NewName")
OldName
Old name in the type library
NewName
The Name to be home, informs the old Name
The rename attribute is 2 work around The name collision problems. If this attribute is specified, The compiler replaces all occurrences of OldName in a type library with The user - supplied NewName in The resulting header files.
This attribute can be informs the when a name in the type library coincides with a macro definition in the system header files. If This situation is not resolved, then various syntax errors will be generated, to as C2059 and C2061.
Note The replacement is The for a name, informs in The type library, not for a name, informs in The resulting header file.
Here is an example: Suppose a property named MyParent exists in a type library, and a macro GetMyParent is defined in a header file and 2 # before the import. Since GetMyParent is the default name of a wrapper function for error handling - the get property, a name collision will occur. To work around the problem, use the following attribute in the # import statement:
Rename (" MyParent MyParentX ", "")
Which renames the name MyParent in the type library. An attempt to rename the GetMyParent wrapper name will fail:
Rename (" GetMyParent GetMyParentX ", "")
This is because the name GetMyParent only occurs in the resulting type library header file.
CodePudding user response:
Is it because the name of the class and not in the same file name??CodePudding user response:
It may be because with ABC Structure caused by the nuptial? But ABC VS2015 Structure not new things ah, have had, why only in VS2015 Enterprise edition did not appear this problem? Which is equipped with VS 2015 outside the Enterprise also help give it a try?CodePudding user response:
MFC under VS2010 project successfully adding in c + + class ABCCodePudding user response:
2015 version didn't met this problem before, I was VS2015 Enterprise edition,