读书人

:GetSystemDefaultLangID()这个方法是

发布时间: 2013-12-26 00:35:35 作者: rapoo

::GetSystemDefaultLangID()这个方法是什么意思?
这个方法我F12之后进入了WinNls.h中的
WINBASEAPI
LANGID
WINAPI
GetSystemDefaultLangID(void);
我的问题是一般调用类都是 1、类名::函数方法(){}这样调用,而2、这个只是::函数方法(){}.
请问这两种有什么区别吗?域名函数在第一个中不懂,谢谢
[解决办法]
问的问题有点模糊啊。。
:: 一般可理解为调用windows系统函数,也可理解调用SDK的函数(区别于调用类内部的函数);

例子就是
class A: public class CWnd
{
void Func()
{
MessageBox(...); //调用的是CWnd::MessageBox();
::MessageBox(); //调用的是SDK 中的MessageBox();
}
}
希望能够理解
[解决办法]
::有三种用法


1.::name //全局作用域
2.class::name //类作用域
3.namespace::name //名字空间作用域

[解决办法]
Global Names
A name of an object, function, or enumerator is global if it is introduced outside any function or class or prefixed by the global unary scope operator (::), and if it is not used in conjunction with any of these binary operators:

Scope-resolution (::)

读书人网 >C++

热点推荐