I've noticed that this tutorial dosen't work if you're trying to read binary files, I don't if the problem is at ReadFile or at WM_SETTEXT, but how would I solve this problem?
Posted on 2005-08-17 19:17:44 by Lenin
ReadFile should have no problems in loading binary files. In fact thats really all it can load, just so happens that all files are binary files. But displaying a binary file is very different from a text file because while a text file is already in a perfect format for displaying (i.e text) a binay file will need to be converted to another format for display.

What that format is depends on the type of file. Maybe use a binary to hex function from masmlib to display the file as a hex dump or if you understand the structre of the file you could probably choose a more specific conversion function. Provide us with more info and someone will be able to help.
Posted on 2005-08-17 20:29:40 by Eóin
If I wanted to open an exe file for instance, woulld I convert it to hex?
Posted on 2005-08-18 04:10:53 by Lenin
You could use the bin2hex function from masmlib
Posted on 2005-08-18 07:15:00 by Eóin
Lenin, if you want to display a binary file in a standard windows control, you should indeed convert the binary data to a hexadecimal string instead. There's plenty of "bin2hex" routines floating around, I believe there was also a speed-optimizing "contest" here once :)

Another approach would be using a hex editing control - KetilO has one at http://www.radasm.com/projects/projects.html
Posted on 2005-08-18 07:25:21 by f0dder
Thanks :) I'll search for that speed contest.

A totally of topic question: In Dev-C++ there's a checkbox with the option "use Windows XP styles", that makes you use windows xp styles :P, you know those fancy button and hollover effects that XP has. I don't like those plain square buttons that come by default when using MASM (they come like that in Dev also if you don't check that checkbox). How would I use Windows XP's styles in MASM?
Posted on 2005-08-18 18:02:12 by Lenin

How would I use Windows XP's styles in MASM?

You'll need to set up a "manifest" XML file - there should be information about it here on the board, otherwise googling for "XP manifest XML" might help.

Btw, try having a look at http://www.codeblocks.org/ , that's a pretty decent IDE as well, and will let you use the VC2003 compiler (which is better than GCC and can be downloaded for free from microsoft).
Posted on 2005-08-18 18:04:35 by f0dder
Posted on 2005-08-18 18:50:42 by Lenin