Re: Window creation in win32 dll
- From: "Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx>
- Date: Thu, 8 Sep 2005 10:17:49 +0200
Be aware that VS2003+ MFC build on ATL and now is very thing shell of API
opposite to previous version , I mean : worth to check using of it in your
app
Arkady
"Dinesh Ahuja" <DineshAhuja@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9AFB8647-4292-496B-811A-9FB98A83E2E0@xxxxxxxxxxxxxxxx
> Thanks a lot for your nice suggestion. It worked. Sorry for being late in
> replying as i was just going through MFC code.
>
>
> Regards
> Dinesh
> --
> Dinesh
>
>
> "Arkady Frenkel" wrote:
>
>> You have example how to do what you need - that MFC's C(Async)Socket
>> class.It create hidden window exactly for the same purposes , just take
>> code
>> from sokcore.cpp of the MFC
>> Arkady
>>
>> "Dinesh Ahuja" <DineshAhuja@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:97C6FBE4-38C7-4EF6-8E84-674A78FC223F@xxxxxxxxxxxxxxxx
>> > Hi All,
>> >
>> > I am trying to create window in a thread which is being spawned by a
>> > dll.
>> > The thread calls RegisterClass and CreateWindow. A call to
>> > RegisterClassEx
>> > succeeded but call to CreateWindow failed with below mentioned error
>> > "The system cannot find the file specified."
>> > I need to use winsock event model where i need to create hidden window
>> > for
>> > handling winsock events.
>> >
>> > I am using HINSTANCE as a handle to DLL module
>> >
>> > A pseude-code for Thread Function is as follows:
>> >
>> > WNDCLASSEX wcex;
>> > ZeroMemory(&wcex,sizeof(WNDCLASSEX));
>> > wcex.cbSize = sizeof(WNDCLASSEX);
>> > wcex.style = CS_GLOBALCLASS;
>> > wcex.lpfnWndProc = WinProc;
>> > wcex.cbClsExtra = 0;
>> > wcex.cbWndExtra = 0;
>> > wcex.hInstance = hInst; // hInst =
>> > (HINSTANCE)GetModuleHandle("DPSPublisher.dll");
>> > wcex.hIcon = NULL;
>> > wcex.hCursor = NULL;
>> > wcex.hbrBackground= NULL;
>> > wcex.lpszMenuName= NULL;
>> > wcex.lpszClassName= szClassName;
>> > wcex.hIconSm = NULL;
>> >
>> > RegisterClassEx(&wcex); // SUCCEEDED
>> > HWND hWnd = CreateWindow(szClassName, NULL, WS_CAPTION |
>> > WS_POPUPWINDOW,
>> > 0, 0, 0, 0, NULL, NULL, hInst, NULL); // FAILED
>> >
>> > Could anyone please guide me over this as how to create a hidden window
>> > in
>> > a
>> > thread spawned by dll. I tried to use this dll in console app and win
>> > app
>> > but
>> > in both cases it failed.
>> >
>> > Regards
>> > Dinesh-Ahuja
>> >
>>
>>
>>
.
- Follow-Ups:
- Re: Window creation in win32 dll
- From: Dinesh Ahuja
- Re: Window creation in win32 dll
- References:
- Window creation in win32 dll
- From: Dinesh Ahuja
- Re: Window creation in win32 dll
- From: Arkady Frenkel
- Re: Window creation in win32 dll
- From: Dinesh Ahuja
- Window creation in win32 dll
- Prev by Date: Re: DLL used in two processes
- Next by Date: Re: Critical Sections vs. Mutexes
- Previous by thread: Re: Window creation in win32 dll
- Next by thread: Re: Window creation in win32 dll
- Index(es):
Relevant Pages
|