#include "d3dApp.h"
#include <WindowsX.h>
#include <sstream>
namespace
{
// This is just used to forward Windows messages from a global window
// procedure to our member function window procedure because we cannot
// assign a member function to WNDCLASS::lpfnWndProc.
D3DApp* gd3dApp = 0;
}
LRESULT CALLBACK
MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// Forward hwnd on because we can get messages (e.g., WM_CREATE)
// before CreateWindow returns, and thus before mhMainWnd is valid.
return gd3dApp->MsgProc(hwnd, msg, wParam, lParam);
}
C++에서 네임 스페이스를 사용하는 것에 대해 궁금합니다. 네임 스페이스에 대한 문서를 읽기 시작했고 "네임 스페이스 우선"과 같은 네임 스페이스의 이름을 호출하는 많은 예제를 보았지만 이와 같은 네임 스페이스 선언 후에는 아무 것도 사용하지 않았습니다.C++에서 네임 스페이스를 사용합니까?
여기에 질문이 있습니까? – kba
이것은 익명의 네임 스페이스입니다. http://stackoverflow.com/questions/154469/unnamed-anonymous-namespaces-vs-static-functions – Yang
이것은 익명의 네임 스페이스입니다. 위의 코드가 전역 변수의 외부 링크를 사용하지 않는 C++ 방법 (C에서는 정적이라고 선언하는 것)을 말하는 사람이 있음을 기억합니다. – dreamlax