什么是"接口"关键字MSVC? [英] What is the "interface" keyword in MSVC?

查看:206
本文介绍了什么是"接口"关键字MSVC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待通过Windows 8.1 SDK,并在UnknownBase.h我看到像

I'm looking through the Windows 8.1 SDK and in UnknownBase.h I'm seeing things like

typedef interface IUnknown IUnknown;

我以前从未见过这种接口关键字。请注意,这无疑是一种 .H 头,通过 cl.exe时处理。这不是IDL文件,它不是由 MIDL.EXE 处理。

I've never seen this interface keyword before. Note that this is very definitely a .h header, processed by cl.exe. It's not IDL file, and it's not processed by midl.exe.

我发现这个在线:<一href=\"http://msdn.microsoft.com/en-us/library/50h7kwtb.aspx\">http://msdn.microsoft.com/en-us/library/50h7kwtb.aspx

__接口是不一样的接口

任何人都可以线索,我会在这里?

Can anyone clue me in here?

推荐答案

微软有一些具体的编译器的扩展,如一个你联系,但接口不应该是原生C ++编译器特定的关键字,而是一个定义哪些替代的东西(在BaseTyps.h它曾经被定义如下)

Microsoft has some compiler-specific extensions like the one you linked but interface shouldn't be a native C++ compiler-specific keyword but rather a define which substitutes something (in BaseTyps.h it used to be defined as follows)

# define interface  struct

<一个href=\"http://www.math.uiuc.edu/~gfrancis/illimath/windows/aszgard_mini/bin/MinGW/include/basetyps.h\">Link这里

如果你想验证这一点做一个的grep 这样的定义,你应该找到类似的东西。

If you want to verify this do a grep for such a definition and you should find something similar.

参考文献:<一href=\"http://social.msdn.microsoft.com/forums/vstudio/en-US/06bf1dea-1d20-4ec3-b9a1-3d673d7fcd8d/what-is-the-interface-keyword-in-native-c\">http://social.msdn.microsoft.com/forums/vstudio/en-US/06bf1dea-1d20-4ec3-b9a1-3d673d7fcd8d/what-is-the-interface-keyword-in-native-c

这篇关于什么是&QUOT;接口&QUOT;关键字MSVC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆