So I'm using the code below to create a window from a DLL. I've tried this code in an application, and it worked, but it does not seem to work from a DLL. I get "1" on the return so I know the program is properly loading the DLL, but the window is never created. I've also tested the "double windowt", and was able to change the size of that window so I know I'm passing the argument correctly.

DLL double startup(double windowt,double x1,double y1,double x2,double y2)
{HWND window=(HWND)(DWORD)windowt;
browse=window;
WNDCLASS wc;
//create window
//HINSTANCE hInstance=GetModuleHandle(NULL);
HINSTANCE hInstance = (HINSTANCE)GetWindowLong(window, GWL_HINSTANCE);
wc.style = CS_OWNDC;
wc.lpfnWndProc = NULL;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = (HBRUSH)GetStockObject( BLACK_BRUSH );
wc.lpszMenuName = NULL;
wc.lpszClassName = "eRun";
RegisterClass( &wc );
HWND hWnd = CreateWindow( "eRun", "eRun Loading...", WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE,0, 0, x2, y2,NULL, NULL, hInstance, NULL );
return 1;}