Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCFile Error When Writing Pin
AmbiguousName14-May-14 1:52
AmbiguousName14-May-14 1:52 
QuestionRe: CFile Error When Writing Pin
CPallini14-May-14 2:34
mveCPallini14-May-14 2:34 
AnswerRe: CFile Error When Writing Pin
AmbiguousName14-May-14 6:57
AmbiguousName14-May-14 6:57 
AnswerRe: CFile Error When Writing Pin
Software_Developer14-May-14 6:36
Software_Developer14-May-14 6:36 
GeneralRe: CFile Error When Writing Pin
AmbiguousName14-May-14 6:56
AmbiguousName14-May-14 6:56 
GeneralRe: CFile Error When Writing Pin
Software_Developer14-May-14 7:27
Software_Developer14-May-14 7:27 
GeneralRe: CFile Error When Writing Pin
Richard MacCutchan14-May-14 21:55
mveRichard MacCutchan14-May-14 21:55 
GeneralRe: CFile Error When Writing Pin
leon de boer15-May-14 4:26
leon de boer15-May-14 4:26 
Supercoder has given you the most likely answer although I agree with Richard you haven't conclusively shown the file is open.

If the file doesn't exist you could have a problem because you probably need to open it with
CFile::modeCreate | CFile::modeReadWrite

Stick a debug point on the fail case and check.

For the write you have a single line

=> pFile->Write((void*)pData, dwLength);

Either

1.) pData is not a pointer to an actual array of data
2.) dwLength has not been set or exceeds the data in pData

So all you have to do is work out which of the three things you got wrong and fix it.

If you can't fix it we need to see how you defined pData and where you set dwLength probably.
In vino veritas


modified 15-May-14 10:36am.

AnswerRe: CFile Error When Writing Pin
Jonathan Davies14-May-14 7:42
Jonathan Davies14-May-14 7:42 
QuestionIf I use a library, do I need DLL file ? Pin
_Flaviu12-May-14 21:50
_Flaviu12-May-14 21:50 
AnswerRe: If I use a library, do I need DLL file ? Pin
«_Superman_»12-May-14 22:11
professional«_Superman_»12-May-14 22:11 
GeneralRe: If I use a library, do I need DLL file ? Pin
AssemToCode14-May-14 17:46
AssemToCode14-May-14 17:46 
AnswerRe: If I use a library, do I need DLL file ? Pin
Legor14-May-14 21:59
Legor14-May-14 21:59 
GeneralRe: If I use a library, do I need DLL file ? Pin
_Flaviu14-May-14 23:54
_Flaviu14-May-14 23:54 
GeneralRe: If I use a library, do I need DLL file ? Pin
Legor15-May-14 0:30
Legor15-May-14 0:30 
GeneralRe: If I use a library, do I need DLL file ? Pin
_Flaviu15-May-14 1:32
_Flaviu15-May-14 1:32 
GeneralRe: If I use a library, do I need DLL file ? Pin
Legor15-May-14 2:29
Legor15-May-14 2:29 
GeneralRe: If I use a library, do I need DLL file ? Pin
_Flaviu15-May-14 4:01
_Flaviu15-May-14 4:01 
GeneralRe: If I use a library, do I need DLL file ? Pin
_Flaviu19-May-14 21:50
_Flaviu19-May-14 21:50 
GeneralRe: If I use a library, do I need DLL file ? Pin
Legor19-May-14 23:46
Legor19-May-14 23:46 
Questionwrite Series of this program 1+-3+5+-7+9+-11 in c++ Pin
Beiniam12-May-14 5:22
Beiniam12-May-14 5:22 
QuestionRe: write Series of this program 1+-3+5+-7+9+-11 in c++ Pin
jeron112-May-14 5:38
jeron112-May-14 5:38 
AnswerRe: write Series of this program 1+-3+5+-7+9+-11 in c++ Pin
«_Superman_»12-May-14 19:11
professional«_Superman_»12-May-14 19:11 
AnswerI can only point you in the right direction... Pin
Software_Developer12-May-14 23:42
Software_Developer12-May-14 23:42 
AnswerRe: write Series of this program 1+-3+5+-7+9+-11 in c++ Pin
C_Vivek Arya13-May-14 5:33
C_Vivek Arya13-May-14 5:33 

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.