Problems with setStateInformation not being called

I’m trying to use getStateInformation and setStateInformation in order to save and load parameter settings between user sessions, via data written to an XML file. However, any code that I put into the setStateInformation method is never reached. getStateInformation is being called appropriately, so I’m wondering if I am missing something obvious about how setStateInformation was intended to be used. When is the setter function supposed to be called, and what issues might cause it to be ignored?

I’ve tried setting JUCE_VST_RETURN_HEX_VERSION_NUMBER_DIRECTLY=1, as was recommended on this thread. However, this didn’t change any of the current behavior. I’m running JUCE 4.2.1 on Windows 7, and using Visual Studio 2010.

It is called exactly one time, when a saved session is opened to restore the saved state of the plugin. It is never called when you add the plugin.

I figured that was the case, however I haven’t been able to verify that the method is being called, or have any code written there executed in either Sequoia or Audiomulch. Have you experienced any variation in behavior depending on which host is being used?

I’m sorry, I only tested Cubase and ProTools.
Eventually you need to write at least a “hello world” in the getStateInformation, otherwise the host might skip the setStateInformation as well.
Maybe somebody else can chime in for AudioMulch and Sequoia.