My programmed extension (windows forms) for masshunter freezes when opened

Hi,

I programmed a module/extension (windows forms) for masshunter quantitative analysis.

When I use my self-programmed module while I'm in the Visual Studio Masshunter test environment, it works. BUT if I start the normal masshunter quantitative analyse software, it doesn't work. My windows form is freezing and windows tells me that my module can't/doesn't recognize.

I use the code:
FormX.Show()
When I use the code .ShowDialog(), it doesn't freeze and I can use my windows form. But then the synchronize navigation in masshunter doesn't work anymore. It works again when I closed my windows forms.

I tried it out with a MessageBox, too. There is the same situation.

What did I wrong?

EDIT: It seems that the navigation synchronize is working, but the "Current Compound" (see picture below) doesn't work anymore.

When I'm using the .ShowDialog()-method in my self-programmed window it doesn't work like a dialog-window. It works like a normal window.

Parents
  • Just curious, do you want the MassHunter main window to "freeze" while using your custom form?

    The Show function shows the form in a non modal form. This means that you can click on the parent form.

    ShowDialog shows the form modally, meaning you cannot go to the parent form

    Borrowed from https://stackoverflow.com/a/20859112

    Anyway, I have not attempted this myself, but if you look in "...\MassHunter\Scripts\Unknowns\Actions", the script: "HitDiff.py" opens a new form/window. You might want to try doing it in this manner - if that is not already what you're doing.

Reply
  • Just curious, do you want the MassHunter main window to "freeze" while using your custom form?

    The Show function shows the form in a non modal form. This means that you can click on the parent form.

    ShowDialog shows the form modally, meaning you cannot go to the parent form

    Borrowed from https://stackoverflow.com/a/20859112

    Anyway, I have not attempted this myself, but if you look in "...\MassHunter\Scripts\Unknowns\Actions", the script: "HitDiff.py" opens a new form/window. You might want to try doing it in this manner - if that is not already what you're doing.

Children
Was this helpful?