LARGE_INTEGER共用体的一个问题

沙尘暗影 2013-11-13 09:29:33

里面的两个结构体,一个没有名字,一个带u,为什么这样设计?是不是很多余?
...全文
139 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
沙尘暗影 2013-11-13
  • 打赏
  • 举报
回复
引用 3 楼 turingo 的回复:
你去掉u试试看。

[quote=引用 2 楼 alanmaths 的回复:]
[quote=引用 1 楼 turingo 的回复:]
可以避免命名冲突。

[quote=引用 楼主 alanmaths 的回复:]

里面的两个结构体,一个没有名字,一个带u,为什么这样设计?是不是很多余?
[/quote]怎么个冲突法?[/quote][/quote]去掉之后,改成这个样子,并没出现问题
图灵狗 2013-11-13
  • 打赏
  • 举报
回复
你去掉u试试看。
引用 2 楼 alanmaths 的回复:
[quote=引用 1 楼 turingo 的回复:] 可以避免命名冲突。 [quote=引用 楼主 alanmaths 的回复:] 里面的两个结构体,一个没有名字,一个带u,为什么这样设计?是不是很多余?
[/quote]怎么个冲突法?[/quote]
沙尘暗影 2013-11-13
  • 打赏
  • 举报
回复 1
引用 1 楼 turingo 的回复:
可以避免命名冲突。 [quote=引用 楼主 alanmaths 的回复:] 里面的两个结构体,一个没有名字,一个带u,为什么这样设计?是不是很多余?
[/quote]怎么个冲突法?
图灵狗 2013-11-13
  • 打赏
  • 举报
回复
可以避免命名冲突。
引用 楼主 alanmaths 的回复:
里面的两个结构体,一个没有名字,一个带u,为什么这样设计?是不是很多余?
赵4老师 2013-11-13
  • 打赏
  • 举报
回复
mk:@MSITStore:C:\MSDN98\98VS\2052\MIDL.chm::/devdoc/good/pdobj/midl/mi-legal_682t.htm About This Guide This book is a reference for the Microsoft Interface Definition Language (MIDL) and a user's guide for the MIDL compiler, which generates C language files from your IDL files. Part I, Using the MIDL Compiler, lists the requirements for the C-compiler and pre-processor that MIDL must interoperate with. This section also describes the files that the MIDL compiler generates for RPC stubs, OLE interfaces, and OLE type libraries. Part II, the MIDL Command-Line Reference, contains reference information for each command-line switch and switch option recognized by the MIDL Compiler. Part III, the MIDL Language Reference, contains a reference entry for each keyword in the Microsoft Interface Definition Language. Part IV, MIDL Compiler Errors and Warnings, lists the error and warning messages that the MIDL compiler can generate.
赵4老师 2013-11-13
  • 打赏
  • 举报
回复
MIDL compiler The Microsoft Interface Definition Library (MIDL) compiler can be used to generate a type library. For information about the MIDL compiler, refer to the Microsoft Interface Definition Language Programmer’s Guide and Reference in the Win32 Software Development Kit (SDK) section of the Microsoft Developer’s Network (MSDN).
赵4老师 2013-11-13
  • 打赏
  • 举报
回复
File: "C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\WinNT.h"
    470: #if defined(MIDL_PASS)
    471: typedef struct _LARGE_INTEGER {
    472: #else // MIDL_PASS
    473: typedef union _LARGE_INTEGER {
    474:     struct {
    475:         DWORD LowPart;
    476:         LONG HighPart;
    477:     };
    478:     struct {
    479:         DWORD LowPart;
    480:         LONG HighPart;
    481:     } u;
    482: #endif //MIDL_PASS
    483:     LONGLONG QuadPart;
    484: } LARGE_INTEGER;
MIDL Compiler Errors and Warnings This section lists MIDL compiler error and warning messages. An error or warning message sometimes specifies the name of one or more MIDL compiler mode switches. The MIDL compiler accepts an IDL file when you use some mode switches but generates errors for the same file when you do not use mode switches. For example, you can include certain ACF attributes in an IDL file when you use the /app_config switch, but that IDL file will generate an error if you compile without using the /app_config switch. Command-line errors appear in the following format: Command line error : MIDLnnnn : <error text> [<additional error information>] The additional-error information field provides context-specific information about the error. The information in this field depends on the error message. For example, when an unresolved type-declaration error occurs, the additional-information field displays the name of the type that could not be resolved. Compile-time warnings appear in the following format: <FileName>(line#) : warning MIDLnnnn : <warning text> [optional context information] : Compile-time errors appear in the following format: <FileName>(line#) : error MIDLnnnn : <error text> [optional context information] : Optional context information refers to the context in which the error occurred. The MIDL compiler reports this information to help you quickly find the error in the IDL file. Context information is generated when the MIDL compiler discovers an error during semantic analysis of type and procedure signatures. System error messages appear in the following format: <FileName>(line#) : MIDL error 0xnnnn : "Unexpected internal compiler problem. Try to find a workaround." The absence of relevant context information is not intended to make your life more difficult. This message is generated by an error that was, quite literally, unexpected. The hexadecimal error number is a Windows NT or Windows 9x system error identifier. You may find additional information regarding your particular error in the WINERROR.H or.NTSTATUS.H files. For more information on working around the conditions that caused this error, see the error text for compiler error MIDL9008.

64,636

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧