Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Is it the fact that using only one kind of programming language would probably restrict your capacity? Pin
Joe Woodbury16-May-13 6:16
professionalJoe Woodbury16-May-13 6:16 
GeneralRe: Is it the fact that using only one kind of programming language would probably restrict your capacity? Pin
Erudite_Eric16-May-13 7:54
Erudite_Eric16-May-13 7:54 
AnswerRe: Is it the fact that using only one kind of programming language would probably restrict your capacity? Pin
MicroVirus17-May-13 1:34
MicroVirus17-May-13 1:34 
GeneralRe: Is it the fact that using only one kind of programming language would probably restrict your capacity? Pin
rudiestf17-May-13 2:51
rudiestf17-May-13 2:51 
AnswerJack of many languages, and master of one (C++ in your case) Pin
Amarnath S17-May-13 7:05
professionalAmarnath S17-May-13 7:05 
Questionich ran correctly unfret2008 Visual C++ in static mode? Pin
Anthony Appleyard15-May-13 12:21
Anthony Appleyard15-May-13 12:21 
AnswerRe: ich ran correctly unfret2008 Visual C++ in static mode? Pin
Richard MacCutchan15-May-13 22:12
mveRichard MacCutchan15-May-13 22:12 
GeneralRe: 2008 Visual C++ in static mode? Pin
Anthony Appleyard15-May-13 23:48
Anthony Appleyard15-May-13 23:48 
The affected program text was writing to a .BMP graphics file.
It used fopen() and fwrite(), and it acted odd. (It always behaved correctly under Windows Vista; I now have Windows 8.).

Just now I changed it to using _sopen_s() and _write(), and FOR NOW it seems to be behaving correctly.

The text that writes to the .BMP file is now this:-

if(_sopen_s(&fil,out,_O_RDWR|_O_CREAT|_O_BINARY, _SH_DENYNO, _S_IREAD|_S_IWRITE)) {
M="I can't open this file"; goto BAD;}
for(i=0;i<256;i++) {BM[54+i*4]=BM[54+i*4+1]=BM[54+i*4+2]=(char)i; BM[54+i*4+3]=0;} /* palettes */
BM[0]='B'; BM[1]='M'; *((long*)(BM+2))=(54+1024+ly*lxx)&0x7fffffff; /* file size */
BM[6]=BM[7]=BM[8]=BM[9]=0;
BM[10]=54; BM[11]=4; BM[12]=BM[13]=0; /* 54+1024 = data offset, little-endian */
BM[14]=40; BM[15]=BM[16]=BM[17]=0;
*((long*)(BM+18))=lx; *((long*)(BM+22))=ly; /* image size */ BM[26]=1; BM[27]=0; /* nplanes*/
BM[28]=8; BM[29]=0; /* bpp */
BM[30]=BM[31]=BM[32]=BM[33]=0; /* no compression */
*((long*)(BM+34))=ly*lxx; /* image size */
BM[38]=100; BM[39]=BM[40]=BM[41]=0; BM[42]=100; BM[43]=BM[44]=BM[45]=0; /* resolution/inch */
BM[46]=0; BM[47]=1; BM[48]=BM[49]=BM[50]=0; BM[51]=1; BM[52]=BM[53]=0; /* 256 = ncolors'es */
BM[5]&=0x7f; _write(fil,BM,54+1024); _write(fil,D,ly*lxx); _close(fil);
sprintf(BM,"I have created this texture map file, it should have %d bytes",54+1024+ly*lxx);
MessageBox(wn,out,BM,MB_OK); BAD: FF(D); FF(DI); goto DEF;}

modified 16-May-13 6:02am.

GeneralRe: 2008 Visual C++ in static mode? Pin
Richard MacCutchan16-May-13 1:23
mveRichard MacCutchan16-May-13 1:23 
AnswerRe: ich ran correctly unfret2008 Visual C++ in static mode? Pin
jschell16-May-13 8:24
jschell16-May-13 8:24 
QuestionCompress short fixed length string (52 characters) down to less than 40. Pin
hatemtaleb15-May-13 2:52
hatemtaleb15-May-13 2:52 
AnswerRe: Compress short fixed length string (52 characters) down to less than 40. Pin
Jochen Arndt15-May-13 3:48
professionalJochen Arndt15-May-13 3:48 
AnswerRe: Compress short fixed length string (52 characters) down to less than 40. Pin
Joe Woodbury15-May-13 8:26
professionalJoe Woodbury15-May-13 8:26 
AnswerRe: Compress short fixed length string (52 characters) down to less than 40. Pin
David Crow15-May-13 10:38
David Crow15-May-13 10:38 
AnswerRe: Compress short fixed length string (52 characters) down to less than 40. Pin
dusty_dex17-May-13 14:47
dusty_dex17-May-13 14:47 
GeneralRe: Compress short fixed length string (52 characters) down to less than 40. Pin
hatemtaleb24-May-13 4:12
hatemtaleb24-May-13 4:12 
QuestionSetCheck on click in CListCtrl Pin
_Flaviu15-May-13 2:30
_Flaviu15-May-13 2:30 
AnswerRe: SetCheck on click in CListCtrl Pin
Jochen Arndt15-May-13 3:33
professionalJochen Arndt15-May-13 3:33 
GeneralRe: SetCheck on click in CListCtrl Pin
_Flaviu15-May-13 20:53
_Flaviu15-May-13 20:53 
GeneralRe: SetCheck on click in CListCtrl Pin
Jochen Arndt15-May-13 21:05
professionalJochen Arndt15-May-13 21:05 
GeneralRe: SetCheck on click in CListCtrl Pin
_Flaviu15-May-13 21:26
_Flaviu15-May-13 21:26 
GeneralRe: SetCheck on click in CListCtrl Pin
Jochen Arndt15-May-13 21:36
professionalJochen Arndt15-May-13 21:36 
GeneralRe: SetCheck on click in CListCtrl Pin
_Flaviu15-May-13 23:07
_Flaviu15-May-13 23:07 
GeneralRe: SetCheck on click in CListCtrl Pin
Jochen Arndt15-May-13 23:20
professionalJochen Arndt15-May-13 23:20 
GeneralRe: SetCheck on click in CListCtrl Pin
_Flaviu15-May-13 23:24
_Flaviu15-May-13 23:24 

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.