We help IT Professionals succeed at work.

what is this meaning "if(::GetModulePath(strPath))"

gamjaradio
gamjaradio asked
on
if(::GetModulePath(strPath))
{

}

I Dont know the meaing of "::" in front of GetModuePath method
Comment
Watch Question

In your case ::GetModulePath(strPath) calls the global GetModulePath() function (i.e. WIN32 API) and not the MFC one

Author

Commented:
then , :: this is not related to inheritance , but just call a global function?
Commented:
There is no such function in Win32. :(
GetModuleFileName or GetModuleFileNameEx:
http://msdn.microsoft.com/en-us/library/ms683197(VS.85).aspx

Do you know what is this namespace in C++?
http://www.cplusplus.com/doc/tutorial/namespaces/
http://www.cprogramming.com/tutorial/namespaces.html

::  scope-resolution operator allows to get the namespace member explicitly. When you call ::GetModuleFileName, you call function from the global namespace:
MSDN. Explicit Qualification
http://msdn.microsoft.com/en-us/library/84ad8xz9(v=VS.100).aspx