# I failed, annoyances got fixed

I was making a youtube video to showcase how to use BEdit to examine TTF-files, and it was working quite fine. Some quality issues with the audio but we fixed those afterwards but no major issues... except, I found a bug.

Unless I'm mistaken I wrote in the previous post
Jens
This means I will have to restrain myself to not fixing annoyances I find
and well... I failed :D The issue in question was a bug in displaying enum values, but you know - while fixing that I might as well implement a related feature and make a new version. For some reason I feel like every update should include a new feature if there are any planned.

Version 0.1.3 is now available for download, now with flag-like enum editing support.

Oh and if you like the style of video linked above, please let me know as I wouldn't mind sharing explorations of different file formats if there is interest.
Simon Anciaux, Edited by Simon Anciaux on
I bought the GUI version but it crashes directly whenever I launch it. It's crashing in a ReadFile call. I'm on windows 7. Do I need to pass the layout and data file as arguments when I launch the GUI ?
Jens, Edited by Jens on
I haven't seen any crashes on startup before, but I did fix a bug in file reading for version 0.1.2. I haven't tested BEdit on Windows 7 but I would consider it supported.

Is it always crashing at startup? Did anything get saved to %localappdata%\BEdit (this is where current theme settings and etc. is stored)? By any chance do you have a crash dump that I could look at?

Since the only thing BEdit is trying to read at startup is the theme from %localappdata%, is your app data using non-ASCII characters? In that case I might have a bug in the UTF-16 handling.

You can pass the files as arguments like BEdit.exe my_layout.bet my_data.dat (or even just drag'n'drop them on top of the executable icon), but of course that should not be needed.

EDIT: ... well, it also loads the font from file.
Simon Anciaux,
It always crashes.
Here is a crash dump.
The appdata folder only contains a config file.
There are only ascii character in the path.
Edited by its1z0 on
If you are using the Windows API, this may help. If not ignore this :D.

I'm not 100% sure but i think i had a similar problem on Windows7.

 1 2 3 4 5 6 7 BOOL ReadFile( HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ); 

Windows 7 seems to require a valid DWORD pointer to the "lpNumberOfBytesRead" otherwise it crashes.
If you pass it a NULL pointer it just dies. At least in my case.

Didn't work:
 1 ReadFile(handle, buffer, readbytes, NULL, NULL); 

Worked:
 1 2 DWORD gotbytes; ReadFile(handle, buffer, readbytes, &gotbytes, NULL); 

Maybe this helps.
Simon Anciaux,
The parameter can't be null if the last parameter is null. The ReadFile doc says:
This parameter can be NULL only when the lpOverlapped parameter is not NULL.
Jens,
This is indeed the bug, not only did I make the mistake in ReadFile but also in WriteFile. I also tested this on Windows 8 (had an old surface that I forgot to upgrade during the free period) and that does not seem to care if it's NULL or not.

Thank you for finding the issue!
Jens,
I was about to finish dinner and test the build but then... Blue screen of death followed by windows failing to restart the network adapter.

Thankfully this little apartment has several computers so I still managed to make a build and release 0.1.3.1 with the ReadFile and WriteFile fix. You can find it uploaded to itch io.

As I initially thought it was a unicode translation bug I also found and fixed another issue that occured when launching BEdit from non-ASCII path.

Thank you mrmixer for sharing this issue, I will download a virtual machine and test Windows 7 on a regular basis in the future. Let me know if the fix is working for you! (I also made an issue ticket regarding this one.)
Simon Anciaux,
It's working.