Click here to Skip to main content
15,898,134 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSocket Events Question Pin
jerry1211a14-Dec-04 4:37
jerry1211a14-Dec-04 4:37 
GeneralRe: Socket Events Question Pin
Iain Clarke, Warrior Programmer14-Dec-04 5:53
Iain Clarke, Warrior Programmer14-Dec-04 5:53 
Generalicon issues of windows XP and 2K Pin
includeh1014-Dec-04 3:16
includeh1014-Dec-04 3:16 
GeneralCAsyncMonikerFile Pin
PetoG14-Dec-04 3:08
PetoG14-Dec-04 3:08 
Generalprogrammatically prevent dialog from resize and move Pin
erkanina14-Dec-04 2:36
erkanina14-Dec-04 2:36 
GeneralRe: programmatically prevent dialog from resize and move Pin
Blake Miller14-Dec-04 4:09
Blake Miller14-Dec-04 4:09 
GeneralRe: programmatically prevent dialog from resize and move Pin
erkanina14-Dec-04 21:28
erkanina14-Dec-04 21:28 
Generalproblem with writing to file Pin
gamitech14-Dec-04 2:26
gamitech14-Dec-04 2:26 
I am trying to make a map of a file ant then write it in another file
but I cannot do it I get an error when writing can you please tell me why ?

HANDLE hMapFile,hFile;<br />
<br />
hMapFile=CreateFile("c:\\fish.txt",<br />
					GENERIC_READ|GENERIC_WRITE|0,<br />
					FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE,<br />
					NULL,<br />
					OPEN_EXISTING,<br />
					FILE_ATTRIBUTE_NORMAL,<br />
					NULL);<br />
<br />
hFile = CreateFileMapping(hMapFile,    // Current file handle. <br />
    NULL,                              // Default security. <br />
    PAGE_READWRITE,                    // Read/write permission. <br />
    0,                                 // Max. object size. <br />
    0,                                 // Size of hFile. <br />
    "MyFileMappingObject");            // Name of mapping object. <br />
 <br />
if (hMapFile == NULL) <br />
{ <br />
MessageBox(NULL,"error","",MB_OK);<br />
} <br />
LPVOID file;<br />
<br />
DWORD length;<br />
length=GetFileSize(hMapFile,0);<br />
<br />
file=(char *)malloc(length);<br />
file=MapViewOfFileEx(<br />
  hFile,   // handle to file-mapping object<br />
  FILE_MAP_ALL_ACCESS,<br />
  0,      // high-order DWORD of offset<br />
  0,       // low-order DWORD of offset<br />
  sizeof(hFile), // number of bytes to map<br />
  0<br />
);<br />
<br />
<br />
FILE *gabby;<br />
gabby=fopen("c:\\out.txt","w");<br />
fprintf(gabby,"%s",file);<br />
fclose(gabby);<br />


?????


gabby
GeneralRe: problem with writing to file Pin
Iain Clarke, Warrior Programmer14-Dec-04 6:01
Iain Clarke, Warrior Programmer14-Dec-04 6:01 
GeneralRe: problem with writing to file Pin
gamitech15-Dec-04 1:08
gamitech15-Dec-04 1:08 
Questionserial comm timeout problem? Pin
doneirik14-Dec-04 2:19
doneirik14-Dec-04 2:19 
AnswerRe: serial comm timeout problem? Pin
Roger Stoltz14-Dec-04 4:30
Roger Stoltz14-Dec-04 4:30 
QuestionDelete object, necessaray?? Pin
tpndtbk14-Dec-04 2:15
tpndtbk14-Dec-04 2:15 
AnswerRe: Delete object, necessaray?? Pin
Maximilien14-Dec-04 2:27
Maximilien14-Dec-04 2:27 
AnswerRe: Delete object, necessaray?? Pin
V.14-Dec-04 3:00
professionalV.14-Dec-04 3:00 
GeneralRe: Delete object, necessaray?? Pin
toxcct14-Dec-04 4:29
toxcct14-Dec-04 4:29 
GeneralRe: Delete object, necessaray?? Pin
V.14-Dec-04 4:38
professionalV.14-Dec-04 4:38 
GeneralRe: Delete object, necessaray?? Pin
toxcct14-Dec-04 4:53
toxcct14-Dec-04 4:53 
GeneralRe: Delete object, necessaray?? Pin
David Crow14-Dec-04 5:24
David Crow14-Dec-04 5:24 
AnswerRe: Delete object, necessaray?? Pin
tpndtbk14-Dec-04 3:30
tpndtbk14-Dec-04 3:30 
GeneralRe: Delete object, necessaray?? Pin
tpndtbk14-Dec-04 3:34
tpndtbk14-Dec-04 3:34 
GeneralRe: Delete object, necessaray?? Pin
Jon Hulatt14-Dec-04 4:19
Jon Hulatt14-Dec-04 4:19 
GeneralRe: Delete object, necessaray?? Pin
David Crow14-Dec-04 5:36
David Crow14-Dec-04 5:36 
AnswerRe: Delete object, necessaray?? Pin
toxcct14-Dec-04 4:36
toxcct14-Dec-04 4:36 
Generala ftp server where download XP for free Pin
Anonymous14-Dec-04 1:21
Anonymous14-Dec-04 1:21 

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.