Original Post
My Crt leak checker doesn't find any leaks, however I get this with D3D_DEBUG_INFO: "This may be due to a corruption of the heap..." with a break as indicated with --> below: The program operates fine, but for some reason it breaks at the end of the init window function. Wierd. It does this even if I turn off my crt memory leak checks. Up to the call to create the window, the program hasn't done anything at all yet. g_hwnd and g_hinstance are globals and init_window is in a seperate module. It should be something simple I'm guessing/hoping..
//---------------------
// I N I T W I N D O W
//---------------------
bool init_window(HWND &g_hwnd,HINSTANCE &g_instance) {
ULONG window_width, window_height;
WNDCLASS window_class;
DWORD style;
ZeroMemory(&window_class, sizeof(WNDCLASS));
#ifdef WINDOWED_MODE
window_class.style = CS_HREDRAW | CS_VREDRAW;//CS_OWNDC;
window_class.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
#else
window_class.style = CS_OWNDC;
#endif
window_class.cbClsExtra = 0; window_class.cbWndExtra = 0;
window_class.hInstance = g_instance;
window_class.hCursor = LoadCursor(NULL,IDC_ARROW);
window_class.lpszMenuName = NULL;
window_class.lpszClassName = g_wnd_class_name;
window_class.lpfnWndProc = default_window_proc;
if(!RegisterClass(&window_class)) FatalError(L"Error registering window class");
window_width=GetSystemMetrics(SM_CXSCREEN); window_height=GetSystemMetrics(SM_CYSCREEN);
#ifdef WINDOWED_MODE
style=WS_OVERLAPPEDWINDOW;
#else
style=WS_EX_TOPMOST | WS_POPUP | WS_VISIBLE;
#endif
g_hwnd=CreateWindow(g_wnd_class_name,g_app_name,style,
0,0,window_width,window_height,NULL,NULL,
g_instance,NULL);
if(!g_hwnd) {Problem=L"Error opening window";return false;}
ShowWindow(g_hwnd,SW_SHOW);UpdateWindow(g_hwnd);SetFocus(g_hwnd);
return true;
/*--->BREAKS HERE--->*/ }