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