It ok Manju!
buntyrolln
It ok Manju!
buntyrolln
Ok leave it man,this discuss is getting longer :-D .
buntyrolln
ya but you are asking question to the person who is asking a question,so your question is not the main question. Because of that some confusion arises.
buntyrolln
why you reply message selecting question button,you may select reply or General radio button!!!!
buntyrolln
Please help me in reading large files in java.i encountered OutofMemoryError.
buntyrolln
You can go through the link given below. Go through the details of each and every Read and Write functions. http://msdn.microsoft.com/en-us/library/ms810467.aspx[^] If you do not get the solution your queries are always welcome.
buntyrolln
Use Richedit instead of smple Editbox. There you can add function on message EN_MSGFILTER. This permits filtering of mouse and keyboard message in the control. TODO: The control will not send this notification unless you override the CDialog::OnInitDialog() function to send the EM_SETEVENTMASK message to the control with either the ENM_KEYEVENTS or ENM_MOUSEEVENTS flag ORed into the lParam mask. inside OnInitDialog mask the key events m_rich.SetEventMask(m_rich.GetEventMask()|ENM_KEYEVENTS); `` void CExampleDlg::OnMsgfilter(NMHDR* pNMHDR, LRESULT* pResult) { MSGFILTER *pMsgFilter = reinterpret_cast(pNMHDR); //TODO: Add your control notification handler code here CString buf; if(pMsgFilter->msg==WM_CHAR ) { buf+=pMsgFilter->wParam; } *pResult = 0; }
buntyrolln
Continuation of above reply .... you can use overlapped-IO operation for communication with serial com port. Read code snippet for overlapped-IO is given below: DWORD dwRead; BOOL fWaitingOnRead = FALSE; OVERLAPPED osReader = {0}; // Create the overlapped event. Must be closed before exiting // to avoid a handle leak. osReader.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); if (osReader.hEvent == NULL) // Error creating overlapped event; abort. if (!fWaitingOnRead) { // Issue read operation. if (!ReadFile(hComm, lpBuf, READ_BUF_SIZE, &dwRead, &osReader)) { if (GetLastError() != ERROR_IO_PENDING) // read not delayed? // Error in communications; report it. else fWaitingOnRead = TRUE; } else { // read completed immediately HandleASuccessfulRead(lpBuf, dwRead); } }
buntyrolln
Communications events can occur at any time in the course of using a communications port. The two steps involved in receiving notification of communications events are as follows: * SetCommMask sets the desired events that cause a notification. * WaitCommEvent issues a status check. The status check can be an overlapped or nonoverlapped operation, just as the read and write operations can be. There are two interesting side effects of SetCommMask and WaitCommEvent. First, if the communications port is open for nonoverlapped operation, WaitCommEvent will be blocked until an event occurs. If another thread calls SetCommMask to set a new event mask, that thread will be blocked on the call to SetCommMask. The reason is that the original call to WaitCommEvent in the first thread is still executing. The call to SetCommMask blocks the thread until the WaitCommEvent function returns in the first thread. This side effect is universal for ports open for nonoverlapped I/O. If a thread is blocked on any communications function and another thread calls a communications function, the second thread is blocked until the communications function returns in the first thread. The second interesting note about these functions is their use on a port open for overlapped operation. If SetCommMask sets a new event mask, any pending WaitCommEvent will complete successfully, and the event mask produced by the operation is NULL. For more details you can refer link given below: http://msdn.microsoft.com/en-us/library/ms810467.aspx[^]
buntyrolln