Click here to Skip to main content
15,925,255 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Create DLL Pin
jhwurmbach12-Oct-07 2:14
jhwurmbach12-Oct-07 2:14 
GeneralRe: Create DLL Pin
Gui_p12-Oct-07 3:35
Gui_p12-Oct-07 3:35 
Question[SOLVED] Initialize empty buffer Pin
CodingLover12-Oct-07 0:41
CodingLover12-Oct-07 0:41 
AnswerRe: Initialize empty buffer Pin
toxcct12-Oct-07 0:48
toxcct12-Oct-07 0:48 
GeneralRe: Initialize empty buffer Pin
CodingLover12-Oct-07 0:53
CodingLover12-Oct-07 0:53 
GeneralRe: Initialize empty buffer Pin
chandu00412-Oct-07 0:59
chandu00412-Oct-07 0:59 
GeneralRe: Initialize empty buffer Pin
CodingLover12-Oct-07 1:07
CodingLover12-Oct-07 1:07 
GeneralRe: Initialize empty buffer Pin
Nelek12-Oct-07 1:10
protectorNelek12-Oct-07 1:10 
mmm,

you are writing "text of letters" (16 chars including '\0'), but you have actually 256 bytes in the buffer and is not a pointer so the size is fix to you init value. That means the rest is going to be written with waste values.

Try:

void CSRFToolDlg::OnBnClickedWrite()
{
char* tempBufferWrite = NULL;

tempBufferWrite = new char[256];

tempBufferWrite = "text of letters";  //or something longer, it should be the same

openFile.Write(tempBufferWrite , sizeof(tempBufferWrite)) ;
openFile.Flush() ;
}




Greetings.

--------
M.D.V.

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

Help me to understand what I'm saying, and I'll explain it better to you

Wink | ;)

GeneralRe: Initialize empty buffer Pin
CodingLover12-Oct-07 1:19
CodingLover12-Oct-07 1:19 
GeneralRe: Initialize empty buffer Pin
Nishad S12-Oct-07 1:20
Nishad S12-Oct-07 1:20 
GeneralRe: Initialize empty buffer Pin
Nelek12-Oct-07 2:02
protectorNelek12-Oct-07 2:02 
GeneralRe: Initialize empty buffer Pin
chandu00412-Oct-07 1:38
chandu00412-Oct-07 1:38 
GeneralRe: Initialize empty buffer Pin
David Crow12-Oct-07 2:54
David Crow12-Oct-07 2:54 
GeneralRe: Initialize empty buffer Pin
chandu00412-Oct-07 3:10
chandu00412-Oct-07 3:10 
GeneralRe: Initialize empty buffer Pin
David Crow12-Oct-07 3:40
David Crow12-Oct-07 3:40 
GeneralRe: Initialize empty buffer Pin
chandu00412-Oct-07 5:44
chandu00412-Oct-07 5:44 
GeneralRe: Initialize empty buffer Pin
David Crow12-Oct-07 5:49
David Crow12-Oct-07 5:49 
GeneralRe: Initialize empty buffer Pin
chandu00412-Oct-07 6:21
chandu00412-Oct-07 6:21 
GeneralRe: Initialize empty buffer Pin
Nelek12-Oct-07 4:01
protectorNelek12-Oct-07 4:01 
GeneralRe: Initialize empty buffer Pin
chandu00412-Oct-07 5:54
chandu00412-Oct-07 5:54 
GeneralRe: Initialize empty buffer Pin
CodingLover14-Oct-07 17:52
CodingLover14-Oct-07 17:52 
AnswerRe: Initialize empty buffer Pin
toxcct12-Oct-07 2:06
toxcct12-Oct-07 2:06 
GeneralRe: Initialize empty buffer Pin
CodingLover14-Oct-07 17:57
CodingLover14-Oct-07 17:57 
AnswerRe: Initialize empty buffer Pin
Mike Dimmick12-Oct-07 6:13
Mike Dimmick12-Oct-07 6:13 
GeneralRe: Initialize empty buffer Pin
CodingLover14-Oct-07 18:01
CodingLover14-Oct-07 18:01 

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.