Click here to Skip to main content
15,907,328 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: context menu dismissed Pin
Stephen Hewitt12-Sep-07 21:27
Stephen Hewitt12-Sep-07 21:27 
GeneralRe: context menu dismissed Pin
AchillesXu12-Sep-07 21:47
AchillesXu12-Sep-07 21:47 
QuestionHow to use a COM but no .h files Pin
kcynic12-Sep-07 19:49
kcynic12-Sep-07 19:49 
AnswerRe: How to use a COM but no .h files Pin
Stephen Hewitt12-Sep-07 20:22
Stephen Hewitt12-Sep-07 20:22 
GeneralRe: How to use a COM but no .h files Pin
kcynic12-Sep-07 20:34
kcynic12-Sep-07 20:34 
GeneralRe: How to use a COM but no .h files Pin
Stephen Hewitt12-Sep-07 20:38
Stephen Hewitt12-Sep-07 20:38 
GeneralRe: How to use a COM but no .h files Pin
kcynic12-Sep-07 21:25
kcynic12-Sep-07 21:25 
QuestionProblems writing to a file Pin
TheInfernalCrow12-Sep-07 19:38
TheInfernalCrow12-Sep-07 19:38 
He there,

I wrote a DLL in which i have got a function that shall be passed some data and a filename and it shall save the data into the file.

I tried three diffeent ways and at all off the three I get the message that I am not allowed to write to the file ("Access denied").

The first way I tried:

FILE *File;<br />
	File = fopen("strName", "w+");<br />
	fprintf(File, "Test");<br />
	fflush(File);<br />
	fclose(File);


The message comes when I reach the fflush line, when i delete it, the message comes at the fclose line.

The second way:

CFile FileHF;<br />
	FileHF.Open(strName, CFile::modeCreate | CFile::modeWrite | CFile::modeNoTruncate);<br />
	FileHF.Write(pHF, sizeof(pHF));<br />
	FileHF.Close();


This is the way i found around the internet told as working, not with me Frown | :( I get the message in the File.Write line.

The third way:

CFile FileHF;<br />
	FileHF.Open(strName, CFile::modeCreate | CFile::modeWrite | CFile::modeNoTruncate);<br />
        CArchive ar(&FileHF, CArchive::store);<br />
	ar << (int)pHF;


This way I found in a book, but here I get the Message in the CArchive line.


I am out of knowledge and ut of sources which could tell me the right way. Could you please?
thx
Lars
AnswerRe: Problems writing to a file Pin
Nishad S12-Sep-07 20:51
Nishad S12-Sep-07 20:51 
QuestionRe: Problems writing to a file Pin
nbugalia12-Sep-07 21:37
nbugalia12-Sep-07 21:37 
AnswerRe: Problems writing to a file Pin
TheInfernalCrow12-Sep-07 21:46
TheInfernalCrow12-Sep-07 21:46 
AnswerRe: Problems writing to a file Pin
chandu00412-Sep-07 22:08
chandu00412-Sep-07 22:08 
GeneralRe: Problems writing to a file Pin
TheInfernalCrow12-Sep-07 22:49
TheInfernalCrow12-Sep-07 22:49 
GeneralRe: Problems writing to a file Pin
chandu00412-Sep-07 23:08
chandu00412-Sep-07 23:08 
AnswerRe: Problems writing to a file Pin
nbugalia12-Sep-07 23:37
nbugalia12-Sep-07 23:37 
GeneralRe: Problems writing to a file Pin
TheInfernalCrow12-Sep-07 23:45
TheInfernalCrow12-Sep-07 23:45 
AnswerRe: Problems writing to a file Pin
Nishad S13-Sep-07 0:23
Nishad S13-Sep-07 0:23 
QuestionRe: Problems writing to a file Pin
David Crow13-Sep-07 3:08
David Crow13-Sep-07 3:08 
QuestionHi I want to know how to distinguish two mouse signal. Pin
Charles of Korea12-Sep-07 16:40
Charles of Korea12-Sep-07 16:40 
AnswerRe: Hi I want to know how to distinguish two mouse signal. Pin
Sreedhar DV12-Sep-07 19:25
Sreedhar DV12-Sep-07 19:25 
GeneralRe: Hi I want to know how to distinguish two mouse signal. Pin
Roger Broomfield12-Sep-07 21:29
Roger Broomfield12-Sep-07 21:29 
QuestionVery Basic socket programming, Winsock! Newb help.. Pin
Beaon12-Sep-07 7:55
Beaon12-Sep-07 7:55 
AnswerRe: Very Basic socket programming, Winsock! Newb help.. Pin
Mark Salsbery12-Sep-07 8:06
Mark Salsbery12-Sep-07 8:06 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Beaon13-Sep-07 6:03
Beaon13-Sep-07 6:03 
GeneralRe: Very Basic socket programming, Winsock! Newb help.. Pin
Mark Salsbery13-Sep-07 6:15
Mark Salsbery13-Sep-07 6: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.