How do I execute some code before the plugin window initializes?

I have this code at the start of my PluginEditor constructor:

//load the default skin
    juce::File exeDir = juce::File::getSpecialLocation(juce::File::currentExecutableFile).getParentDirectory();
    juce::File skinFile = exeDir.getChildFile("Resources").getChildFile("Skins").getChildFile("Default.json");

    if (skinFile.existsAsFile())
    {
        juce::Logger::writeToLog("PluginEditor: Default skin loaded successfully");
        GraphicsImporter::load(skinFile);
    }
    else {
        juce::Logger::writeToLog("PluginEditor: Could not load skin: " + skinFile.getFullPathName());
    }

which I hope would load a simple JSON file which I could then load values from, however I don’t get any output when I run this in VisualStudio so what am I doing wrong?

My guess is that your Logger isn’t set up correctly to write to the Visual Studio output window. Someone else here will tell you how to set it up correctly. But if all you want to do is quick and easy printing to the output window for simple debugging, then you can use DBG() instead of juce::Logger::writeToLog().

well in the same class I get output when calling the logger::writeToLog() function in other methodfs:

// Paint
void AddictiveAudioProcessorEditor::paint(juce::Graphics& g)
{
juce::Logger::writeToLog(“paint”);
}

I can see the output of this call. Also using DBG didn’t work either

Have you tried putting a breakpoint, or a jassertfalse;in your constructor? Perhaps it isn’t getting called.

Right now I don’t have access to this code as I am at work but I am 100% certain the constructor gets called at least once as there are components being created in there that do show on the screen. Also what would be the reason behind a PluginEditor constructor not being called (assuming I am showing the plugin window of course)

Sorry if some of my questions are a bit dumb it has been a few years for me since I last worked with JUCE & Cpp for that matter…