Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool Box is Broken #2763

Closed
ghost opened this issue May 29, 2021 · 5 comments
Closed

Tool Box is Broken #2763

ghost opened this issue May 29, 2021 · 5 comments
Labels
App: EmuHawk Relating to EmuHawk frontend Ghost'd OP's username has been lost to time Repro: Affects 2.6.2 Repro: Fixed/added in 2.6.3

Comments

@ghost
Copy link

ghost commented May 29, 2021

Summary

- When opening Trace Logger, clicking on: File-->Save log--> cancelling the operation, triggers an error prompt which appears over and over even after closing trace logger and changing roms. Fixes by restarting bizhawk fixed

  • Similar issues with Tool Box, if opened with bizhawk full screen, the box appears blank if hovered on the task bar/trying to reach it with alt+tab. Reducing the size of bizhawk window or just moving it doesnt seem to make the Tool Box available. If closing the white box from taskbar, and reopening it with bizhawk not on full screen, makes it appear.
    Clicking on this button on the Tool Box:

Immagine

and then loading a rom, gives this Error dialog, which keeps appearing when switching roms, or trying to use other features really

************** Testo dell'eccezione **************
System.InvalidOperationException: Impossibile chiamare Invoke o BeginInvoke su un controllo finché non viene creato un handle di finestra.
   in System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   in System.Windows.Forms.Control.BeginInvoke(Delegate method, Object[] args)
   in BizHawk.Client.EmuHawk.LogWindow.append(String str, Boolean invoked)
   in System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
   in System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
   in System.IO.TextWriter.SyncTextWriter.WriteLine(String value)
   in System.Console.WriteLine(String value)
   in BizHawk.Client.EmuHawk.MainForm.LoadRomInternal(String path, LoadRomArgs args, Boolean& failureIsFromAskSave)
   in BizHawk.Client.EmuHawk.MainForm.LoadRom(String path, LoadRomArgs args, Boolean& failureIsFromAskSave)
   in BizHawk.Client.EmuHawk.MainForm.LoadRomFromRecent(String rom)
   in System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   in System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   in System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   in System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   in System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   in System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   in System.Windows.Forms.Control.WndProc(Message& m)
   in System.Windows.Forms.ToolStrip.WndProc(Message& m)
   in System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Tested on bizhawk 2.6.2

Fixes by completely closing and reopening bizhawk

@ghost
Copy link
Author

ghost commented May 29, 2021

There is another major issue with toolbox. Opening a rom, and then trying to open tastudio from it... kinda "breaks" the game file.
I cant open it anymore in bizhawk, i deleted the whole folder, restarted the pc, and then redownloaded a fresh bizhawk 2.6.2.

Trying to load that specific .cue now triggers this:

image

and i cant actually run said game anymore in ANY way.

Repro:

  1. Open bizhawk
  2. Load a rom
  3. Open toolbox
  4. Open tastudio from toolbox
  5. Error dialog, that game file apparently wont even load anymore even after rebooting and deleting/redownloading a new bizhawk from scratch.

Edit: managed to do it still using toolbox but just opening and closing the other tools. No error dialogs, except that when i tried to re-run other game.cue, this other one was also now broken, had to ACTUALLY replace the game roms.

@alyosha-tas
Copy link
Contributor

trace logger is a simple fix.

Toolbox appears to be substantially broken, and makes the program unstable. That weird icon you circled is somehow an instance of BizHawk.Client.EmuHawk.ToolFormBase which of course makes no sense. I can easily filter that out in SetTools() of toolbox.cs, but many other problems remain.

Perhaps it should be disabled pending a rewrite or thorough investigation of why it is causing such problems (I don't really get what's going wrong.)

@alyosha-tas alyosha-tas changed the title Trace logger and Tool Box prompts error dialogs and keep invoking them Tool Box is Broken May 29, 2021
@YoshiRulz YoshiRulz added App: EmuHawk Relating to EmuHawk frontend Repro: Affects 2.6.2 labels May 30, 2021
@alyosha-tas
Copy link
Contributor

So the problem here is definitely this line:
var instance = Activator.CreateInstance(t)

Those instances are messing everything up. The toolbox works fine if I comment that out and just give everything a generic icon.

I can't figure out how to get rid of the instances though, there doesn't seem to be an opposite to Activator that takes care of it.

Alternatively I could just match up every tool name to an icon manually and that would sort it out.

@YoshiRulz
Copy link
Member

As it happens, I already found this bug, and wrote a fix, but decided not to use it... (fe6bf7b) I've quickly recreated it as 2704003 for you to work with.

@alyosha-tas
Copy link
Contributor

Thanks, but that still doesn't work, it gives a bunch of errors if I open toolbox then open a rom.

I think I'll just do the manually assigning thing to avoid those instances altogether. A quick test of that doesn't give me any errors.

@YoshiRulz YoshiRulz added the Ghost'd OP's username has been lost to time label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App: EmuHawk Relating to EmuHawk frontend Ghost'd OP's username has been lost to time Repro: Affects 2.6.2 Repro: Fixed/added in 2.6.3
Projects
None yet
Development

No branches or pull requests

2 participants