I made a dll to just create a window so I don't have to do it everytime and I'm getting an access violation on a bunch of stuff. The first to go was LoadCursor(), now its GetStockObject(). Here's some code:
I was told from someone that LoadCursor wasn't pointing to a valid instance handle and that's what caused it, but, I don't want to use a resource, I want the predefined IDC_ARROW. Is there anyway to do this?Code:bool ArkCore::ArkCreateWindow(HINSTANCE hInstance, char* Title) { hInst = hInstance; WNDCLASSEX wcex; /////Fill in the Window class structure - Describes how the window will look wcex.cbSize = sizeof( WNDCLASSEX ); //size of the structure wcex.style = CS_HREDRAW | CS_VREDRAW; //the class style wcex.lpfnWndProc = (WNDPROC)MsgProc; //Window procedure callback wcex.cbClsExtra = 0; //Extra class bytes wcex.cbWndExtra = 0; //Extra window bytes wcex.hInstance = hInstance; //Handle to the app instance wcex.hIcon = NULL; // icon wcex.hCursor = LoadCursor(NULL, IDC_ARROW); <--//ACCESS VIOLATION wcex.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH); //<----ACCESS VIOLATION



LinkBack URL
About LinkBacks



. This forum is bringing back some old C++ memories too, I think I'll stick around for awhile and help some people out lol..too bad the game programming forum is kind of dead I could be of more use there but oh well. Anyways, Thanks again for the support rocky, your solution has been professional and very helpful. The best of luck to ya mate.