Click here to Skip to main content
15,891,567 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Can I handle click events on a static control Pin
Randor 10-Jan-09 6:15
professional Randor 10-Jan-09 6:15 
GeneralRe: Can I handle click events on a static control [modified] Pin
sashoalm10-Jan-09 6:59
sashoalm10-Jan-09 6:59 
GeneralRe: Can I handle click events on a static control Pin
sashoalm10-Jan-09 7:32
sashoalm10-Jan-09 7:32 
GeneralRe: Can I handle click events on a static control Pin
Randor 10-Jan-09 7:35
professional Randor 10-Jan-09 7:35 
GeneralRe: Can I handle click events on a static control Pin
Jijo.Raj10-Jan-09 6:57
Jijo.Raj10-Jan-09 6:57 
GeneralRe: Can I handle click events on a static control Pin
sashoalm10-Jan-09 7:04
sashoalm10-Jan-09 7:04 
QuestionLayoutRTL creating issues in displaying image data Pin
Alex@9C10-Jan-09 0:17
Alex@9C10-Jan-09 0:17 
QuestionCFile::sharingViolation exception? Pin
AnayKulkarni10-Jan-09 0:05
AnayKulkarni10-Jan-09 0:05 
Hello to all,
First of all let me tell you what I am doing in my project, in my project I am collecting some data from two devices, one device is having USB connector and another device is having serial port (RS232) connector.
Now I will tell you the main problem, In my project I am creating one file and writting the data collected from any one of above device, into that file.The function in which I have written file writting operation code gets called after each 10 seconds. But problem is that when I collect data from device having serial port (RS232) connector then sometimes I get "CFile::sharingViolation" exception in file operation.I am giving my code also here. In below code "CreateRawDataFile()" function gets called after each 10 seconds and this function contains the code regarding file handling operation.

void CMainFrame::CreateRawDataFile()
{
CFile oRawFile;
CFileException ExceptionObj;
if(oRawFileIO.Open(FileName,CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite,&ExceptionObj)==FALSE)
{
if(ExceptionObj.m_cause == CFileException::sharingViolation)
{
TRACE("\n Sharing violation");
}
}
else
{
code for writting data in a file
.
.
.
.
oRawFile.Close();
}
}

In above function sometimes I get "CFileException::sharingViolation" exception and then the TRACE statement which I have written gets displayed.Most surprising thing is that this file exception occurs only when I collect the data from the device having serial port (RS232) connector.Also I have checked that call to above function is going exactly after each 10 seconds and not before that.Also data is not much long which will not get written into file within 10 seconds.Most surprisingly it works very much accuratly without any file exception when I collect data from the device having USB connector.

Really I am not getting what exactly happening? Please can any body tell me what to do and how to remove this problem? It is really really very very urgent? Please help me out.

Thanks and Regards,

Anay
AnswerRe: CFile::sharingViolation exception? Pin
Stuart Dootson10-Jan-09 0:12
professionalStuart Dootson10-Jan-09 0:12 
Questionhow to deal with HTTP message in Chtmlview(MFC) Pin
maoxintt9-Jan-09 22:56
maoxintt9-Jan-09 22:56 
AnswerRe: how to deal with HTTP message in Chtmlview(MFC) Pin
Stuart Dootson10-Jan-09 0:06
professionalStuart Dootson10-Jan-09 0:06 
GeneralRe: how to deal with HTTP message in Chtmlview(MFC) Pin
maoxintt11-Jan-09 1:59
maoxintt11-Jan-09 1:59 
GeneralRe: how to deal with HTTP message in Chtmlview(MFC) Pin
Stuart Dootson11-Jan-09 2:14
professionalStuart Dootson11-Jan-09 2:14 
GeneralRe: how to deal with HTTP message in Chtmlview(MFC) Pin
maoxintt11-Jan-09 14:51
maoxintt11-Jan-09 14:51 
Questionwork VB project on VC++ MFC exe Pin
Member 46265689-Jan-09 22:13
Member 46265689-Jan-09 22:13 
AnswerRe: work VB project on VC++ MFC exe Pin
Stuart Dootson9-Jan-09 22:34
professionalStuart Dootson9-Jan-09 22:34 
AnswerRe: work VB project on VC++ MFC exe Pin
Hamid_RT9-Jan-09 23:45
Hamid_RT9-Jan-09 23:45 
QuestionPrint preview list control Pin
Member 23588019-Jan-09 21:07
Member 23588019-Jan-09 21:07 
AnswerRe: Print preview list control Pin
Stuart Dootson9-Jan-09 22:32
professionalStuart Dootson9-Jan-09 22:32 
AnswerRe: Print preview list control Pin
Hamid_RT9-Jan-09 23:46
Hamid_RT9-Jan-09 23:46 
Questionview in a childframe Pin
Taruni9-Jan-09 18:47
Taruni9-Jan-09 18:47 
AnswerRe: view in a childframe Pin
Stuart Dootson9-Jan-09 22:41
professionalStuart Dootson9-Jan-09 22:41 
QuestionHow to set RTL layout for a CPropertySheet. Pin
Alex@9C9-Jan-09 17:50
Alex@9C9-Jan-09 17:50 
AnswerRe: How to set RTL layout for a CPropertySheet. Pin
Stuart Dootson9-Jan-09 22:30
professionalStuart Dootson9-Jan-09 22:30 
GeneralRe: How to set RTL layout for a CPropertySheet. Pin
Alex@9C9-Jan-09 23:15
Alex@9C9-Jan-09 23:15 

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.