When using infile.getline(tempFilename, 256);, could there be extra (hidden) characters in tempFilename? MessageBox() is not exactly the best choice to use for looking at data. Using both methods you described, put a breakpint on the Load_Bitmap_File() line and look at tempFilename in the debugger at that point. See if there are any differences between the two.
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?