Synchronization - Wait Functions
-
I'm creating a ocx in VC which is used for a custom protocol. The main handshaking and connecting to remote host etc., will be handled by a VB app. I only have to read the COM port through my local buffer variable which is set by VB app in OnComm event. If my input buffer is empty, I need to wait till I get something in my buffer? Can someone pls. help me how I can do that wihtout jamming the application. Thanks in advance,
-
I'm creating a ocx in VC which is used for a custom protocol. The main handshaking and connecting to remote host etc., will be handled by a VB app. I only have to read the COM port through my local buffer variable which is set by VB app in OnComm event. If my input buffer is empty, I need to wait till I get something in my buffer? Can someone pls. help me how I can do that wihtout jamming the application. Thanks in advance,
-
Simple example is using thread function which wait to fill the buffer and after it send some flag to your application (Get/Set or Fire - are your choice).
Or, you could use overlapped I/O on the read, triggering a callback function when the read actually occurs (or posting to an I/O Completion Port).
-
Simple example is using thread function which wait to fill the buffer and after it send some flag to your application (Get/Set or Fire - are your choice).
Hi, I tried that with WaitForSingleObject(), but it hangs up the whole thread for certain time and gives timeout messages. As far as I know, Visual Basic run all components in single thread, correct me if I'm wrong. I can't use callback functions, as this code model doesn't integrate with the existing system, which uses some other protocols. For your clarification - I'm working on ZModem, developing VC++ OCX which will be used in VB and Powerbuilder applications.