Click here to Skip to main content
15,913,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ATL service stopping Pin
Christian Graus1-Jul-02 2:27
protectorChristian Graus1-Jul-02 2:27 
GeneralRe: ATL service stopping Pin
Hans Ruck1-Jul-02 2:36
Hans Ruck1-Jul-02 2:36 
GeneralRe: ATL service stopping Pin
Bill Wilson1-Jul-02 9:38
Bill Wilson1-Jul-02 9:38 
QuestionHow to prevent a CFileDialog Box from resizing? Pin
Erik1-Jul-02 2:06
Erik1-Jul-02 2:06 
AnswerRe: How to prevent a CFileDialog Box from resizing? Pin
Prem Kumar1-Jul-02 4:51
Prem Kumar1-Jul-02 4:51 
GeneralRe: How to prevent a CFileDialog Box from resizing? Pin
Erik1-Jul-02 19:02
Erik1-Jul-02 19:02 
GeneralI/O Completion Port Pin
unknown soldier1-Jul-02 0:59
unknown soldier1-Jul-02 0:59 
GeneralRe: I/O Completion Port Pin
Len Holgate1-Jul-02 8:53
Len Holgate1-Jul-02 8:53 
bakhtawar wrote:
Worker threads are associated with I/O completion port. Whenever I/O operation completed a thread is invoked. Now when this thread is invoked, how we come to know that which "type" of operation completed whether "read" or write". I think this has to be determined by overlapped structure but i don't know that which "field" of this structure informs about the "type" of operation completed.

What usually happens is that you don't actually pass only an "overlapped" structure, you pass something that has an overlapped structure in it and also contains other stuff. This allows you to pass anything you like to your thread. Then, once inside your thread you simply convert back from the pointer to the portion of your structure that is an "overlapped" to a pointer to your structure.

If you're using C++ then you might define your overlapped like this:
<br />
class MyOverlapped : public OVERLAPPED<br />
{<br />
   // include your own data here.<br />
};<br />

And then pass it to a read request like this:
<br />
MyOverlapped *pBuffer;<br />
<br />
   if (SOCKET_ERROR == ::WSARecv(<br />
      pSocket->m_socket, <br />
      pBuffer->GetWSABUF(), <br />
      1, <br />
      &dwNumBytes,<br />
      &dwFlags,<br />
      pBuffer, <br />
      NULL))<br />

and retrieve it from
<br />
   MyOverlapped *pBuffer = 0;<br />
<br />
   GetQueuedCompletionStatus(m_iocp, &dwIoSize, (PDWORD_PTR)&pSocket, (OVERLAPPED**)&pBuffer);<br />

See the code for my reusable C++ socket server class for full details.


Len Holgate
www.jetbyte.com
The right code, right now.
GeneralHigh scale chat server Pin
1-Jul-02 0:47
suss1-Jul-02 0:47 
GeneralRe: High scale chat server Pin
benjymous1-Jul-02 2:02
benjymous1-Jul-02 2:02 
GeneralRe: High scale chat server Pin
Len Holgate1-Jul-02 9:01
Len Holgate1-Jul-02 9:01 
GeneralGet code page of exe Pin
ed welch30-Jun-02 23:08
ed welch30-Jun-02 23:08 
GeneralRe: Get code page of exe Pin
Mike Nordell2-Jul-02 7:20
Mike Nordell2-Jul-02 7:20 
QuestionCan I use standard FTP command to check file properties on remote site? Pin
DengJW30-Jun-02 23:08
DengJW30-Jun-02 23:08 
QuestionMy dialog window doesn't process my accellerator keys? Pin
solosnake30-Jun-02 22:54
solosnake30-Jun-02 22:54 
AnswerRe: My dialog window doesn't process my accellerator keys? Pin
Prem Kumar1-Jul-02 4:56
Prem Kumar1-Jul-02 4:56 
QuestionWhether 'Control' Key is pressed ? Pin
nilaysoft30-Jun-02 22:41
nilaysoft30-Jun-02 22:41 
AnswerRe: Whether 'Control' Key is pressed ? Pin
30-Jun-02 23:29
suss30-Jun-02 23:29 
AnswerRe: Whether 'Control' Key is pressed ? Pin
Mustafa Demirhan1-Jul-02 7:09
Mustafa Demirhan1-Jul-02 7:09 
QuestionCHtmlView Bug? Pin
Renegade30-Jun-02 22:38
Renegade30-Jun-02 22:38 
GeneralDLL's Pin
urid30-Jun-02 22:32
urid30-Jun-02 22:32 
QuestionHow to get informations from other process Pin
Neil Yao30-Jun-02 22:31
Neil Yao30-Jun-02 22:31 
AnswerRe: How to get informations from other process Pin
Prem Kumar1-Jul-02 0:25
Prem Kumar1-Jul-02 0:25 
GeneralRe: How to get informations from other process Pin
Neil Yao1-Jul-02 15:03
Neil Yao1-Jul-02 15:03 
GeneralForce a tooltip Pin
Davy Mitchell30-Jun-02 22:06
Davy Mitchell30-Jun-02 22:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.