Hello JUCE-Board!
I’m making my first steps with JCUE (though not my first steps with OO-programming) and I’m fairly new to C++, too. So my question is most likely answered in a few sentences, but that’s worth a lot for me, because I can’t get my Logger running without freezing my app.
Ok, here’s what I want to do: I want to write a VST Plugin with JUCE. During construction, I’d like to have stuff logged to a file to see where the plugin hangs or crashes. So basically I have the AudioProcessor class, that has a member variable m_log_file and m_logger just like this:[code]class R7AudioProcessor : public AudioProcessor
{
public:
//==============================================================================
R7AudioProcessor();
~R7AudioProcessor();
...
...
FileLogger m_logger;
File m_log_file;
...
};[/code]
For reasons of RAII i tried it like this, and did not want to use pointers. Now I’m wondering how to corectly initialise these two members. I tried it like this:
R7AudioProcessor::R7AudioProcessor()
:m_log_file("C:\\Log.txt"), m_logger(m_log_file,"Welcome to the log",0)
{
}
When I run this in a VST-Host, it freezes.
So here is my question: How can I force these two members to be constructed before all other members, so log messages about the construction of my vst can be written to a file?
Thanks a lot,
StrangeMan