window from win32 dll
I really fed up with this problem,i have to create one window from
win32 DLL,
BOOL Derived::InitWindow(int left,int top,int width,int
height,HINSTANCE h)
{
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L,
0L,
h, NULL, NULL, NULL, NULL,
L"Renderer", NULL };
RegisterClassEx( &wc );
// Create the application's window
_hRenderWnd = CreateWindow(L"Renderer",0,
WS_POPUPWINDOW, left, top, width, height,
NULL, NULL, h,
NULL);
return TRUE;
}
msgProc declared diclared in Derived class.static LRESULT WINAPI
MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
..HINSTANCE storing in dllmain HMODULE
CreateWindow always fail..
i tried this way also
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC|CS_HREDRAW |
CS_VREDRAW | CS_OWNDC | CS_GLOBALCLASS, MsgProc, 0L, 0L,
GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
szWindowClass, NULL };
RegisterClassEx( &wc );
// Create the application's window
hwnd = CreateWindow(szWindowClass,L"Title",
WS_POPUPWINDOW| CS_GLOBALCLASS, left, top, width,
height,
GetDesktopWindow(), NULL,GetModuleHandle(NULL),
NULL);
return TRUE;
but all are avail..
this dll is a static dll(lib and header file)
any rule for creating window inside dll?
i must create another thread ?should i call in dllmain?
please help me ..
NB: second post (afterwin32 UI )