The scope resolution operator ( :: ). If you've got a member function called write and you want to call the global one, it should disambiguate the two. This compiles fine.
GeSHi (cpp):
#include <windows.h>
#include <iostream>
class Test
{
public:
void WriteFile()
{
DWORD d;
char a = 'h';
::WriteFile(NULL, &a, 1, &d, NULL);
}
};
int main()
{
Test t;
t.WriteFile();
}
Created by GeSHI 1.0.7.18
I'm sure you know, but to anybody else it's a good idea not to have functions or classes with the same names as windows functions, since most of them are defined as macros which will bring in seemingly strange errors.
GeSHi (cpp):
// example.cpp
class Example
{
public:
void MessageBox();
};
#include <windows.h>
int doMsgBox()
{
Example a;
a.MessageBox(); // error, MessageBoxA/MessageBoxW is not a member of Example
}
Created by GeSHI 1.0.7.18