Click here to Skip to main content
15,914,500 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDialog? Pin
Larsson30-Sep-04 21:29
Larsson30-Sep-04 21:29 
AnswerRe: Dialog? Pin
jtorjo30-Sep-04 22:05
jtorjo30-Sep-04 22:05 
GeneralRe: Dialog? Pin
Larsson30-Sep-04 22:07
Larsson30-Sep-04 22:07 
GeneralRe: Dialog? Pin
BlackDice1-Oct-04 3:46
BlackDice1-Oct-04 3:46 
GeneralRe: Dialog? Pin
jtorjo4-Oct-04 22:31
jtorjo4-Oct-04 22:31 
GeneralCreateFile for reading/writing file Pin
Paolo Ponzano30-Sep-04 21:09
Paolo Ponzano30-Sep-04 21:09 
GeneralRe: CreateFile for reading/writing file Pin
4apai30-Sep-04 21:31
4apai30-Sep-04 21:31 
GeneralRe: CreateFile for reading/writing file Pin
Paolo Ponzano1-Oct-04 0:34
Paolo Ponzano1-Oct-04 0:34 
yes, you're right, here's my code

<br />
<br />
//those 2 handle are obtained into main program<br />
HANDLE source=CreateFile("header", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, NULL, NULL);<br />
HANDLE destination=CreateFile(filename_save, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, NULL, NULL);<br />
bool AppendToBeginOfFile(HANDLE source, HANDLE destination)<br />
{<br />
	DWORD source_size=0,<br />
		  destination_size=0,<br />
		  BRs=0,<br />
		  BRd=0,<br />
		  BW=0;<br />
	char *tmp1=NULL,<br />
		 *tmp2=NULL;<br />
	if((source == NULL) && (destination == NULL)) return false;<br />
	<br />
	source_size=GetFileSize(source, NULL);<br />
	destination_size=GetFileSize(destination, NULL);<br />
<br />
	tmp1=(char*)malloc(source_size*sizeof(char));<br />
	tmp2=(char*)malloc(destination_size*sizeof(char));<br />
<br />
	<br />
bool k=ReadFile(destination, tmp2, destination_size, &BRd, NULL);<br />
	DWORD l=GetLastError();<br />
	k=ReadFile(source, tmp1, source_size, &BRs, NULL);<br />
	l=GetLastError();<br />
	if((BRs < source_size) || (BRd < destination_size)) return false;<br />
<br />
	SetFilePointer(destination, 0 , 0 ,FILE_BEGIN);<br />
	WriteFile(destination, source, source_size, &BW, NULL);<br />
}<br />

GeneralRe: CreateFile for reading/writing file Pin
4apai1-Oct-04 1:12
4apai1-Oct-04 1:12 
GeneralRe: CreateFile for reading/writing file Pin
Paolo Ponzano1-Oct-04 3:27
Paolo Ponzano1-Oct-04 3:27 
GeneralRe: CreateFile for reading/writing file Pin
4apai4-Oct-04 8:01
4apai4-Oct-04 8:01 
GeneralRe: CreateFile for reading/writing file Pin
Blake Miller1-Oct-04 6:26
Blake Miller1-Oct-04 6:26 
GeneralResizing of form view - problem Pin
ledallam30-Sep-04 20:30
ledallam30-Sep-04 20:30 
GeneralRe: Resizing of form view - problem Pin
Sujan Christo30-Sep-04 20:44
Sujan Christo30-Sep-04 20:44 
GeneralRe: Resizing of form view - problem Pin
#realJSOP30-Sep-04 23:49
professional#realJSOP30-Sep-04 23:49 
GeneralRe: Resizing of form view - problem Pin
ledallam1-Oct-04 1:30
ledallam1-Oct-04 1:30 
GeneralRe: Resizing of form view - problem Pin
BlackDice1-Oct-04 3:52
BlackDice1-Oct-04 3:52 
GeneralAdd a scroll bar to Mainframe Pin
ledallam30-Sep-04 20:26
ledallam30-Sep-04 20:26 
GeneralRe: Add a scroll bar to Mainframe Pin
Iain Clarke, Warrior Programmer30-Sep-04 22:58
Iain Clarke, Warrior Programmer30-Sep-04 22:58 
GeneralCopy a File Pin
tgprakash30-Sep-04 19:57
tgprakash30-Sep-04 19:57 
GeneralRe: Copy a File Pin
BlackDice1-Oct-04 4:05
BlackDice1-Oct-04 4:05 
GeneralCORRECTION Pin
BlackDice1-Oct-04 4:07
BlackDice1-Oct-04 4:07 
GeneralRe: CORRECTION Pin
tgprakash3-Oct-04 20:04
tgprakash3-Oct-04 20:04 
Generalto send a http POST request to the url or server Pin
Nison Jose30-Sep-04 19:56
Nison Jose30-Sep-04 19:56 
GeneralRe: to send a http POST request to the url or server Pin
ThatsAlok1-Oct-04 18:37
ThatsAlok1-Oct-04 18: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.