Hi
I'm getting a confusing access violation in the vstHookWndProc of juce_VSTPluginFormat
Now it takes some pretty specific actions to reproduce it, so I'll need to explain how I got this error. I have been able to reproduce this in the pluginHost example, just to make sure it is not related to something else in my project, but I have only tested on windows 7.
I'm using the ApplicationCommandManager and it's key mappings.
If you do nothing, key commands are not recognized after editing a plugin's GUI, as the keys are not relayed to the command manager. (I want this to work as a user might tweak a knob then hit ctrl+s to save.)
So to make the key commands work when the plugin UI has focus I added this to the pluginwindow's constructor
addKeyListener(getCommandManager().getKeyMappings());
Now if this is in some way super stupid then please stop reading and tell me why.
This solves the problem with key commands, and works fine EXCEPT.
If you click on the plugin UI then trigger a key command that deletes the window. (For instance I have a short cut for toggling the plugin UI). This always causes an access violation.
As far as I can tell, what happens is that after the plugin UI is closed and the window has been deleted,
the vstHookWndProc is called on some rubbish data. It is like if the keyboard hook has not been removed before the editor closed (But I doubt Jules would make that mistake).
I'm thinking that I need to call something before closing the window.
calling
commandManager->removeKeyListener(pluginWindow)
before closing does nothing, as the problem seems to be unrelated to that.
Any help on this or how you solved the issue with keyboard focus in the plugin gui would be great.
Regards
Nikolai
PS
I'm getting more and more happy/exited by this framework, it is a work of art.
For any newcomers not instantly getting comfy migrating from their old environment:
It takes some research effort to get up and running, and you might need to rethink some of your old habits but it is sooo worth it.
