Lesson 20 - Can't open file.

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Doom Demise3
Posts: 4
Joined: June 17th, 2013, 8:44 pm

Lesson 20 - Can't open file.

Post by Doom Demise3 » June 17th, 2013, 9:31 pm

I am having a strange problem with trying to open my bitmap file.
In Chili's video, at around 37:00, he debugs the program.

When he reaches the line that reads: fread( signature,sizeof( char ),2,bmpFile );

3 key values are returned:

Code: Select all

bmpFile    | 0x5cede4f8 {_ptr=0x00000000 _cnt=0 _base=0x00000000...
filename   | 0.003fbbbc "WalkinDude\wdude00.bmp"
signature  | 0.0023f9fc "IIIIIIIIIIII ( and lots of random symbols )"
I have written out the programming exactly as he has it as far as I can tell and it failed at this point so I rewrote it again using the same images and file names. Joy-of-joys, it failed in the same point in the same way.

When I reach that same line, the 3 key values that are returned are:

Code: Select all

bmpFile    | 0x00000000 {_ptr=??? _cnt=??? _base=??? ...}
filename   | 0x00f85ad0 "JImages\Title.bmp"
signature  | 0x001ff5a8 "IIIIIIIIIIII"
So, bmpFile is getting 0x00000000 as memory for some reason, the other values appear as ??? and signature gets all of the I's yet doesn't get all of the other symbols.

( Ignore the difference in filename, this is the one not using the same images and file name )

I have no idea why it doesn't work. If anybody has any idea what is wrong, please reply. It has been a few days planted in front of my laptop trying to figure out what is wrong and i'm willing to try anything.

( also, any ideas you have may need to be dumbed down a bit as i'm not even in college yet so this may be over my head... just a bit... )

User avatar
viruskiller
Posts: 399
Joined: June 14th, 2012, 5:07 pm

Re: Lesson 20 - Can't open file.

Post by viruskiller » June 18th, 2013, 7:04 pm

try do exactly as he does and make sure u watch the episode till the end,sometimes he messes something up and fixes it later on.

anyway use the same image as him before trying different stuff.

also for any1 to be able to realize what's wrong u'd have to upload the project, read the sticky on the forum.

Doom Demise3
Posts: 4
Joined: June 17th, 2013, 8:44 pm

Re: Lesson 20 - Can't open file.

Post by Doom Demise3 » June 19th, 2013, 6:29 pm

Ok. I tried again following him as exactly as I could and the result was... The same. Even though Chili sometimes makes mistakes, if I follow him exactly to the point of his first debug, my result should match his.

This time, I am going to upload the files ( hopefully I did it right ), hopefully with it, somebody can tell me where the problem lies.

( If you need more files or the links don't work, just reply and tell me what is needed )
Attachments
Game.cpp
(1.62 KiB) Downloaded 121 times
Bitmap.h
(500 Bytes) Downloaded 131 times
Bitmap.cpp
(500 Bytes) Downloaded 117 times

User avatar
viruskiller
Posts: 399
Joined: June 14th, 2012, 5:07 pm

Re: Lesson 20 - Can't open file.

Post by viruskiller » June 19th, 2013, 7:27 pm

viruskiller wrote:try do exactly as he does and make sure u watch the episode till the end,sometimes he messes something up and fixes it later on.

anyway use the same image as him before trying different stuff.

also for any1 to be able to realize what's wrong u'd have to upload the project, read the sticky on the forum.

User avatar
viruskiller
Posts: 399
Joined: June 14th, 2012, 5:07 pm

Re: Lesson 20 - Can't open file.

Post by viruskiller » June 19th, 2013, 7:28 pm

we need the whole project not just parts of it,

[Sticky] READ THIS FIRST! is on second line on the main forum.

Doom Demise3
Posts: 4
Joined: June 17th, 2013, 8:44 pm

Re: Lesson 20 - Can't open file.

Post by Doom Demise3 » June 21st, 2013, 11:48 pm

Okay. I read the post now and I think I have done it right now. I have deleted the appropriate files and moved it all to a .zip file. For some reason, 2 .zip files were created from this so I'm uploading both here as I don't know which is needed.

( Be warned that "Chili DirectX Framework V12.04.24 (SFX).zip" took far longer to upload and may be irrelevant. I have no idea. Just be warned it may take a long time to download if it is needed. )
Attachments
Chili DirectX Framework V12.04.24 (SFX).zip
(9.44 MiB) Downloaded 131 times
Chili DirectX Framework.zip
(34.02 KiB) Downloaded 115 times

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: Lesson 20 - Can't open file.

Post by LuisR14 » June 22nd, 2013, 12:25 am

hehe the (SFX).zip one was the one :P
ok i see your problem, for some reason your images in the chili directx framework\walkindude folder are named "wdude##.bmp.bmp" :P

edit: probably you have to enable the display of file extensions
if you vista/7: open explorer, click organize->folder and search options, click view, then uncheck hide extensions for known file types
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

Doom Demise3
Posts: 4
Joined: June 17th, 2013, 8:44 pm

Re: Lesson 20 - Can't open file.

Post by Doom Demise3 » June 25th, 2013, 12:03 pm

Thank you so much!
At least it was something easy to fix! :lol:

Post Reply