|
Well, to be honest, i didn't read your code, it's too much. But here's a general hint. It's usually better in Server-Applications that serve many Clients, especially when the maximum number if concurrent clientrequests is high or unknown, to use a thread-pool. That means, on Startup you create a certain number of threads, say 10, in suspended mode. Each time a request comes in, you check if there is a free thread, and if so let that thread handle the request. If all threads are busy, you have queue further requests. Good thing about that is, that on suddenly growing number of requests your server memory requirements don't explode. Also, you don't have the performance overhead of all the thread creation/deletion. I can't give you any more specific advise, but i hope it helps.
|
|
|
|
|
Well, to be honest, i didn't read your code, it's too much. But here's a general hint. It's usually better in Server-Applications that serve many Clients, especially when the maximum number if concurrent clientrequests is high or unknown, to use a thread-pool. That means, on Startup you create a certain number of threads, say 10, in suspended mode. Each time a request comes in, you check if there is a free thread, and if so let that thread handle the request. If all threads are busy, you have to queue further requests. Good thing about that is, that on suddenly growing number of requests your server memory requirements don't explode. Also, you don't have the performance overhead of all the thread creation/deletion. I can't give you any more specific advise, but i hope it helps.
Edit: So that's why they allways say : "Only klick that button once !" ...
|
|
|
|
|
Hi,
I need to pop a small window from below when I move my mouse to a bimap placed below the window and it should disappear once I click on the client area. Iam lack of thoughts .Any suggestions or links would be appreciated.
Thanx in Advance.
Today is a gift, that's why it is called the present
|
|
|
|
|
narayanagvs wrote: pop a small window from below
HWND hWnd=CreateWindow("STATIC","MyWindow",WS_CHILD|WS_VISIBLE|WS_BORDER|WS_POPUPWINDOW ,0,0,0,0,m_hWnd,NULL,GetModuleHandle(NULL),NULL);
for (int i=0;i<100;i++)
{
Sleep(1);
::SetWindowPos (hWnd,NULL,0,0,100,i,SWP_SHOWWINDOW);
}
// This would only be one of the options.
/// You can also try and create a pop up style Menu and use it.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Is there any way to subclass a messagebox, I want to add a hyper link in it.
|
|
|
|
|
LiYS wrote: subclass a messagebox
Hook the message box from your application
hHook = SetWindowsHookEx (WH_CALLWNDPROC,
(HOOKPROC)HookProcedure,
NULL,
GetCurrentThreadId ());
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks,But where should I put messagebox related info to SetWindowsHookEx(...)
|
|
|
|
|
LiYS wrote: But where should I put messagebox related info to SetWindowsHookEx(...)
Put them in the HookProcedure
The prototype for the HookProcedure is
LRESULT CALLBACK HookProcedure(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
You will also have to use these at appropriate places:
CallNextHookEx()
UnHookWindowsHookEx()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Filtering what inside callback?
|
|
|
|
|
LiYS wrote: Filtering what inside callback?
Use this message : WM_INITDIALOG
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have subclass the MessgageBox but with the following winproc the Messagebox onyl display the client area, What wrong?
<br />
LRESULT CALLBACK MessageBoxProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
switch (message)<br />
{<br />
case WM_INITDIALOG:<br />
InitLink(hWnd);<br />
return TRUE;<br />
case WM_DRAWITEM:<br />
DrawLink(hWnd, (UINT)wParam, (LPDRAWITEMSTRUCT)lParam);<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
return CallWindowProc( oldWndProc, hWnd, message, wParam, lParam );<br />
<br />
}<br />
|
|
|
|
|
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Its not for hyper link but maybe it is some helpful to you here[^] and here[^]
|
|
|
|
|
Hello,
I have in the same dialog many windows "CWnd" and I use each window to show various informations. Each window is created with WS_CAPTION style to show a titel.
My problem I would like show the border from each window as active all at the same time ! I did't found any style to do that.
Thank you.
AutreChien
|
|
|
|
|
Hi
i got some problem with my code, Acctually i created two threads, a CWnd class calls the fist thread and the fist thread inreturn calls the second thread.
The second thread calls the member function of CAuthen. the second thread calls authen.CheckAuthentication(); in theat member function, i called a dialog using DoModal(); after displaying the dialog, my application gives some
Assertion Error.
can any one tell me where i did wrong.
class CAuthen:: public CWnd
{
............
..
public:
CAuthenDlg auth_dlg;
..
public :
void checkAuthentication();
};
void CAuthen :: checkAuthentication()
{
..
..
..
if( auth_dlg.DoModal() == IDOK)
{
...
// some operation goes here
}
..
..
}
Thanks in Advance.
Gopinath MV
" Don't Sit Like a Rock, Work Like a Clock "
|
|
|
|
|
gloriousgopi wrote: after displaying the dialog, my application gives some
Assertion Error.
What assertion , its showing ? where its taking you in the code?
|
|
|
|
|
|
Debug Assertion Failed!
Program : file path.
File : wincore.cpp
Line : 884
Gopinath MV
|
|
|
|
|
Its not sufficient for answer
|
|
|
|
|
You might mention that this is not with VC++ v6.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All,
I have created custom log file and its key is added to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\CustomLog. But if I give a path value greater than say 100 characters for File key under CustomLog windows is not taking this path. Is there any restrictions on path length for File key in registry?
C++beginer
|
|
|
|
|
ashokvishnu wrote: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\CustomLog. But if I give a path value greater than say 100 characters for File key under CustomLog windows is not taking this path. Is there any restrictions on path length for File key in registry?
could i know your actual coding syntax
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Re
|
|
|
|
|
Hello all..,
I have to create one socket server application. In which server's prog is written in C Language and is run by CMD prompt..Now i have to develop one client prog by VC++ such that it can call that socket server's prog...
So plz help me!!!!!! that how it can be possible ...and i'm also new to MFC...
Waiting for reply...
alpa shah
|
|
|
|
|
if what u want is to run the exe from the clicent, use ShellExecute.
ShellExecute( 0, _T("open"), _T("c:\\WINDOWS\\system32\\calc") ,0,0,SW_SHOW);
un the place of c:\\WINDOWS\\system32\\calc, put the full path of ur exe.
nave
|
|
|
|
|
Naveen R wrote: ShellExecute( 0, _T("open"), _T("c:\\WINDOWS\\system32\\calc") ,0,0,SW_SHOW);
i believe he want to create Socket Server Program!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|