hi
i am learning directx in c++ but i got some few questions and i got one error:
thats my code:
Code:
#pragma comment(lib, "d3d9.lib")
#include <windows.h>
#include <d3d9.h>
//משתהנים ליצירת הDEVICE
LPDIRECT3D9 m_D3D = NULL;
LPDIRECT3DDEVICE9 m_D3DD = NULL;

HWND hWnd;
#include <d3dx9.h>
//יצירת החלון -- שלב ה initialize

void initD3D(HWND hWnd);   
void Render(void);   

void initD3D() {
m_D3D = Direct3DCreate9( D3D_SDK_VERSION );
// בודקים שהערך שחוזר חיובי
if(m_D3D == NULL)
{
MessageBox(0, L"D3D create failed", L"error", 0);

}
// הגדרת האפשרויות ל החלון
D3DPRESENT_PARAMETERS d3dpm;
ZeroMemory(&d3dpm, sizeof(d3dpm));
d3dpm.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpm.Windowed = TRUE;
d3dpm.SwapEffect = D3DSWAPEFFECT_DISCARD;

// יצירת הDEVICE שירנדר
if(FAILED(m_D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpm, &m_D3DD)))
{
MessageBox(0, L"D3D Device creation failed", L"error", 0);

}

}
void WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
	switch(msg)
	{
	case WM_PAINT:
Render();
	}
}
void Render() {

	m_D3DD->Clear(0, 0, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0);
m_D3DD->BeginScene();



m_D3DD->EndScene();
m_D3DD->Present(0,0,0,0);
}
DWORD WINAPI ThreadMain(LPVOID lpParam);

BOOL APIENTRY DllMain(HANDLE hInst, DWORD dwReason, LPVOID lpReserved)
{
	switch(dwReason)
	{
		case DLL_PROCESS_ATTACH:
			{
				
				DWORD  dwThreadId;
				HANDLE hThread = CreateThread(
					NULL, 0, ThreadMain, NULL, 0, &dwThreadId);
			}
			return TRUE;
		
		case DLL_PROCESS_DETACH:
			return TRUE;
	}
	return FALSE;
}

DWORD WINAPI ThreadMain(LPVOID lpParam)
{
	initD3D();
	
	return true;
}
1) my error is:
"D3D Device creation failed"
2) can someone tell me why in the most of the menus source code that i saw in the code the voids like that : menu::render or menu::initd3d and not like my code just render or just initd3d i know its a class but why do it like that and not a regular void?
3) how can i use a font and write some text?
thx : )