Click here to Skip to main content
15,921,203 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Capturing WM_ACTIVATE in CPropertyPage Pin
dennisV22-Sep-03 2:06
dennisV22-Sep-03 2:06 
GeneralRe: Capturing WM_ACTIVATE in CPropertyPage Pin
jhwurmbach22-Sep-03 2:08
jhwurmbach22-Sep-03 2:08 
GeneralRe: Capturing WM_ACTIVATE in CPropertyPage Pin
dennisV22-Sep-03 2:15
dennisV22-Sep-03 2:15 
Generaldatabse cmd Pin
ranjjj20-Sep-03 23:39
ranjjj20-Sep-03 23:39 
GeneralRe: databse cmd Pin
David Crow22-Sep-03 3:14
David Crow22-Sep-03 3:14 
QuestionKodak Image Edit ActiveX Control?? Pin
nsaadyah20-Sep-03 22:57
nsaadyah20-Sep-03 22:57 
QuestionHow to display Chinese vertically in Opengl Pin
Anonymous20-Sep-03 22:04
Anonymous20-Sep-03 22:04 
QuestionWhy won't this simple thing work? Pin
Pizzaman20-Sep-03 20:58
Pizzaman20-Sep-03 20:58 
Hello,

I am trying to load up bitmaps onto DirectX surfaces. Well anyway...

this is the function prototype:



Load_Bitmap_File(BITMAP_FILE_PTR bitmap, char *filename);

so I tried to read the bitmap names from a file with the following:


<br />
infile.open("TileBitmap.dat");<br />
  int value = 0;<br />
  char tempFilename[256] = {0};<br />
  <br />
 <br />
  while(infile)<br />
  {<br />
    infile >> value; //get the bitmap number<br />
    infile.getline(tempFilename, 256); //get the filename.bmp<br />
    MessageBox(main_window_handle, tempFilename, "Test", MB_OK);<br />
   <br />
    if (!(Load_Bitmap_File(&bit, tempFilename)))<br />
    {<br />
      infile.close(); //close the file<br />
      return 0; //and report error<br />
    }<br />
    LoadBitmapSurface(Tiles[value], surface_desc, bit, TILE_WIDTH, TILE_HEIGHT); //if all good, load it into surface array<br />
<br />
  }<br />
  infile.close();<br />



and the darn thing fails with the Load_Bitmap_File
notice the MessageBox function, it outputs the contents of tempFilename. It displays filename.bmp. So it got the name, but it won't load the bitmap.

So I tried... manual initialization

<br />
char tempFilename[256] = "filename.bmp"<br />
Load_Bitmap_File(&bit, tempFilename);<br />



and that works fine! So what could be the problem here? is it somethhing with the cin.getline?? I checked the length, and it was correct... Please help thanks!

-Pizzaman

-It's like blowing up an abortion center because you are pro life.
AnswerRe: Why won't this simple thing work? Pin
ZoogieZork21-Sep-03 7:42
ZoogieZork21-Sep-03 7:42 
GeneralRe: Why won't this simple thing work? Pin
Pizzaman21-Sep-03 8:10
Pizzaman21-Sep-03 8:10 
AnswerRe: Why won't this simple thing work? Pin
David Crow22-Sep-03 3:21
David Crow22-Sep-03 3:21 
Generalpointers - not updated Pin
JassPZ20-Sep-03 20:24
sussJassPZ20-Sep-03 20:24 
GeneralRe: pointers - not updated Pin
Mike Dimmick21-Sep-03 1:29
Mike Dimmick21-Sep-03 1:29 
GeneralRe: pointers - not updated Pin
Blake Miller22-Sep-03 11:54
Blake Miller22-Sep-03 11:54 
QuestionRemote machine Information??? Pin
maharsoft20-Sep-03 19:49
maharsoft20-Sep-03 19:49 
AnswerRe: Remote machine Information??? Pin
Blake Coverett20-Sep-03 19:59
Blake Coverett20-Sep-03 19:59 
GeneralAPI to capture Login event Pin
rohit.dhamija20-Sep-03 18:50
rohit.dhamija20-Sep-03 18:50 
GeneralRe: API to capture Login event Pin
Mike Dimmick21-Sep-03 1:39
Mike Dimmick21-Sep-03 1:39 
GeneralRe: API to capture Login event Pin
rohit.dhamija21-Sep-03 19:01
rohit.dhamija21-Sep-03 19:01 
GeneralVariant Access Pin
Sirrius20-Sep-03 18:37
Sirrius20-Sep-03 18:37 
GeneralRe: Variant Access Pin
ZoogieZork21-Sep-03 8:00
ZoogieZork21-Sep-03 8:00 
GeneralRe: Variant Access Pin
Sirrius21-Sep-03 17:43
Sirrius21-Sep-03 17:43 
QuestionOld version of C++ 1.32...upgrade? Pin
Matthew Fuchs20-Sep-03 14:49
sussMatthew Fuchs20-Sep-03 14:49 
AnswerRe: Old version of C++ 1.32...upgrade? Pin
Ravi Bhavnani20-Sep-03 16:17
professionalRavi Bhavnani20-Sep-03 16:17 
AnswerRe: Old version of C++ 1.32...upgrade? Pin
David Crow20-Sep-03 16:51
David Crow20-Sep-03 16:51 

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.