|
This parameter of the call specifies the time, in milliseconds, that a client connecting to the pipe will wait for when no free pipe instances are available. You can determine how long the client side function will wait before issuing a time-out. It can be a certain time in milliseconds, the default wait time specified by the server, or it can wait forever.
Here, the default wait time specified by the server is the key phrase. This time period is determined by the nDefaultTimeOut parameter. Each pipe instance created by CreateNamedPipe must specify the same time-out value. This value is supplied only so that clients, which use WaitNamedPipe or CallNamedPipe functions to connect to the named pipe, know how long they should wait, by default, before issuing a time-out error.
If, during this time period, a pipe instance becomes available (the server creates a new instance or some other client disconnects from one pipe instance), then the client-side pipe function will connect to this available pipe.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thanks a lot!!!
One more question....
<br />
LPTSTR lpszPipename = "\\\\.\\pipe\\mynamedpipe"; <br />
HANDLE hEvents = CreateEvent(NULL, TRUE, TRUE, NULL);<br />
OVERLAPPED Overlap;<br />
Overlap.hEvent = hEvents; <br />
<br />
Pipe.hPipeInst = CreateNamedPipe( <br />
lpszPipename,
PIPE_ACCESS_DUPLEX |
FILE_FLAG_OVERLAPPED,
PIPE_TYPE_MESSAGE |
PIPE_READMODE_MESSAGE |
PIPE_WAIT,
INSTANCES,
BUFSIZE,
BUFSIZE,
PIPE_TIMEOUT,
NULL);
<br />
while (1) <br />
{ <br />
BOOL bSuccess = ::ConnectNamedPipe(m_hPipe, lpOverlapped); <br />
dwWait = WaitForMultipleObjects( <br />
INSTANCES,
hEvents,
FALSE,
INFINITE);
switch(dwWait)<br />
{<br />
case ..
}<br />
}<br />
How can I create a new pipe instance using CreateNamedPipe for every new client.
|
|
|
|
|
Named pipes should only be used when you have at least some approximation of how many clients there will be connecting. If you have no idea how many, then I would consider using sockets as a better alternative, for efficiency, safety and listening reasons. Afterall, when the server creates one listening socket, each client can connect to that one and the server will worry about establishing a connection on a seperate socket.
But if you must use pipes, then I suggest that you firstly create just one pipe instance. Always when a client connects to this pipe (handle client connecting), the server will call a function that creates a new pipe instance. This follows the logic: "You don't know how many clients there will be, so always keep at least one pipe instance available for a new client."
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thanks a lot!! I know that the number of clients will be very limited usually max 2, so I think there is not much to worry about....
|
|
|
|
|
Where can i find the IE auto complete form data in the registry or whereever it is stored
any links and help will be much appreciated
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Check out the HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\IntelliForms\SPW registry key.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks i couldnt find the key on my system
i have intelliforms but it has no subkeys may be because i have disabled autocomplete since i can remember
and what about username and passwords i just want to remove all of them (not through IE ) where are they stored ?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
http://www.mastishk.com
|
|
|
|
|
I know of no other location where that information is stored. You might search in the same key under the HKEY_USERS hive. If you are not using Windows 2000, you might search the HKEY_CURRENT_USER hive for the IntelliForms key.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Dear Friends,
I have a .li file which works well in Release Mode but it gives error in Debug Mode. I have told to do necessary modification in .lib file to work satisfactorily in Debug mode.
Will you please write to me how to handle this task. Any kind of suggesion will be highly appreciable.
Thanking You in advance..
Billar
|
|
|
|
|
Can you specify what error you get in Debug mode.
|
|
|
|
|
hot to get font file path to font selected to dc?
all i can get is something depending on actual language, not real file path
(arial bold instead of arialb.ttf, 'bold' is act language dependant)
|
|
|
|
|
Can we change wParam in callback keyboardProc function in order to get the character we want , in the destination window(by changing the actual virtual keycode). In my practice, when I changed the wParam inside callback function I didn't get the desired result(no change in the result) . Can any one help me.
Thanking you
arathi
|
|
|
|
|
Hi !
I'd like to know how many lines of code (real code, without comments) my project is made of. Do you know of any tool to do that ?
I'm using Visual Studio .NET 2003.
Thanks !
Jerome
|
|
|
|
|
|
I need to find out which thread send message to my window's message queue.
Is this possible ?
Thanks
rrrado
|
|
|
|
|
You can achieve that by hooking all the SendMessage PostMessage family of API.
To accomplish that several methods are available, and are well discussed on CP. (API Hooking revealed is quite good)
All you have to do is to search for API Hooking in the search box.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks, I'll look at it
rrrado
|
|
|
|
|
I wrote a class CMKCtrl derived form CWnd following Chris Maunder's CGridCtrl
,but my class doesn't respond to the message WM_KEYDOWN and WM_MOUSEWHEEL.
I can't find the reason.
I need help.
Thanks!
|
|
|
|
|
>> doesn't respond to the message
What does that mean?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I wrote a class CMKCtrl derived form CWnd.
CMKCtrl doesn't Procress the message WM_KEYDOWN and WM_MOUSEWHEEL.
|
|
|
|
|
Hi,
I am using Bluetooth to communicate with an external device. All I do is talk to COM8, its very simple.
However, when my application runs it asks me to select the device from a drop down list of Bluetooth devices. I want to make the device selection automatic but I have no idea how, can anyone point me in the right direction? Could I get a list of devices from the registry?
Many thanks,
Ali
|
|
|
|
|
Instead of poping up the list, parse it looking for your device.
Most devices have a GUID of some sort that you can lookup.
I don't think the resistry is the right direction. Depending on how your app and device works one of those two might be.
|
|
|
|
|
Thanks for the reply.
Henry miller wrote:
Instead of poping up the list, parse it looking for your device.
I don't have a list of devices, that is what I need and then to be able to select one automatically for the user.
What happens at the moment is that the command 'CreateFile' (which opens the comm port) calls a window/program called 'Bluetooth Console' and I manually select the device from there, then it continues to run my application.
I thought perhaps the registry might contain a list of available devices. I've never done anything with the registry so perhaps I am barking up the wrong tree.
Ali
|
|
|
|
|
go to MSDN and lookup setupapi in particular things like SetupDiGetClassDevs. Once you get close there are a lot of functions to lookup and understand - start reading.
I know our code uses those functions somehow to get a list of devices (CD drives in our case), but it is complex, and under several layers of wrappers that I'm not about to unwind if I don't have to. Good luck figuring it out.
|
|
|
|
|
Thanks, I'll go take a look.
I've been 'Googling' for some help with this but I didn't have a starting point and so my searches have been pretty fruitless.
Henry miller wrote:
Once you get close there are a lot of functions to lookup and understand - start reading.
Its sounds like it will take a while so I better stop typing and get on with it!
Cheers,
Ali
|
|
|
|