Click here to Skip to main content
15,916,215 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: hlp its urgent Pin
CPallini1-Mar-10 22:03
mveCPallini1-Mar-10 22:03 
JokeRe: hlp its urgent Pin
KingsGambit1-Mar-10 22:05
KingsGambit1-Mar-10 22:05 
GeneralRe: hlp its urgent Pin
Tim Craig2-Mar-10 12:24
Tim Craig2-Mar-10 12:24 
Question[ask for]The way for Solving "Microsoft Visual C++ Runtime Library" Error. Pin
onlysaint1-Mar-10 20:29
onlysaint1-Mar-10 20:29 
AnswerRe: [ask for]The way for Solving "Microsoft Visual C++ Runtime Library" Error. Pin
Rajesh R Subramanian1-Mar-10 20:34
professionalRajesh R Subramanian1-Mar-10 20:34 
GeneralRe: [ask for]The way for Solving "Microsoft Visual C++ Runtime Library" Error. Pin
onlysaint1-Mar-10 21:59
onlysaint1-Mar-10 21:59 
AnswerRe: [ask for]The way for Solving "Microsoft Visual C++ Runtime Library" Error. [modified] Pin
Stephen Hewitt1-Mar-10 22:32
Stephen Hewitt1-Mar-10 22:32 
GeneralRe: [ask for]The way for Solving "Microsoft Visual C++ Runtime Library" Error. Pin
Rajesh R Subramanian2-Mar-10 0:41
professionalRajesh R Subramanian2-Mar-10 0:41 
GeneralRe: [ask for]The way for Solving "Microsoft Visual C++ Runtime Library" Error. Pin
Stephen Hewitt2-Mar-10 14:31
Stephen Hewitt2-Mar-10 14:31 
GeneralRe: [ask for]The way for Solving "Microsoft Visual C++ Runtime Library" Error. Pin
onlysaint2-Mar-10 0:50
onlysaint2-Mar-10 0:50 
GeneralRe: [ask for]The way for Solving "Microsoft Visual C++ Runtime Library" Error. Pin
Stephen Hewitt2-Mar-10 21:04
Stephen Hewitt2-Mar-10 21:04 
QuestionWrite Mjpeg frames into AVI container Pin
gmallax1-Mar-10 20:01
gmallax1-Mar-10 20:01 
AnswerRe: Write Mjpeg frames into AVI container Pin
TimSWatson27-Apr-10 0:03
TimSWatson27-Apr-10 0:03 
GeneralRe: Write Mjpeg frames into AVI container Pin
gmallax27-Apr-10 0:38
gmallax27-Apr-10 0:38 
GeneralRe: Write Mjpeg frames into AVI container Pin
TimSWatson27-Apr-10 1:59
TimSWatson27-Apr-10 1:59 
GeneralRe: Write Mjpeg frames into AVI container Pin
TimSWatson27-Apr-10 2:16
TimSWatson27-Apr-10 2:16 
GeneralRe: Write Mjpeg frames into AVI container Pin
gmallax27-Apr-10 2:20
gmallax27-Apr-10 2:20 
GeneralRe: Write Mjpeg frames into AVI container Pin
TimSWatson27-Apr-10 3:12
TimSWatson27-Apr-10 3:12 
GeneralRe: Write Mjpeg frames into AVI container Pin
gmallax27-Apr-10 19:31
gmallax27-Apr-10 19:31 
QuestionAny one interested to do Activex component project for money in VC++ Pin
kishore5281-Mar-10 19:41
kishore5281-Mar-10 19:41 
AnswerRe: Any one interested to do Activex component project for money in VC++ Pin
Nelek1-Mar-10 20:15
protectorNelek1-Mar-10 20:15 
QuestionActiveX spreadsheet component Pin
sims9741-Mar-10 10:37
sims9741-Mar-10 10:37 
QuestionInvalid access to memory location - in WriteFile - writting to COM port. [modified] Pin
Vaclav_1-Mar-10 7:09
Vaclav_1-Mar-10 7:09 
I need some hint / help in troubleshooting this error.
It gets retruned by both WriteFile and ReadFile when writting to or reading from file opened for asynchronous ( COM port ) access.
The file is created using

m_hCOM = ::CreateFile(lpszDevice, // COMx
GENERIC_READ|GENERIC_WRITE,
0, // exclusive
0, // security irrelevant
OPEN_EXISTING, // it has to be there
FILE_FLAG_OVERLAPPED, // asynchronous
0); // template file

And this is wherw it fails
// write to comm port
iResult = WriteFile(m_hCOM, (char*) data, dwSize, &dwWritten, &osWrite);

with this cryptic error message
"Invalid access to memory location"


DCB, mask and timeouts are properly configured.
At this time I am wiriting single (dwSize = 1) null '0' character and the OVERLAPPED structure event is set.

I am obviously missing something.


Any constructive help as always is appreciated. Suggestions to copy someone else code are not necessary. Been there - done that.

Vaclav


-- Modified Monday, March 1, 2010 11:06 PM
AnswerRe: Invalid access to memory location - in WriteFile - writting to COM posrt. Pin
Avi Berger1-Mar-10 7:43
Avi Berger1-Mar-10 7:43 
GeneralRe: Invalid access to memory location - in WriteFile - writting to COM posrt. Pin
Vaclav_1-Mar-10 10:37
Vaclav_1-Mar-10 10:37 

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.