I am a complete C++ novice and was trying to get the audio plugin host demo into a dll instead of an application. This is because the interface to an Adobe AIR app I am creating requires a DLL format. I have looked at the VST Wrapper class and it is a little over my head.
All I really need is to see, is a very basic example of a very simple Juce app in DLL form and a Juce app that uses that DLL
To that end, I have spent about three days trying to do it myself and about three hours scouring the forums for anything useful.
If anybody can provide the most basic of examples, I would greatly appreciate it.
Essentially, you just need to drop all the JUCEApplication stuff, and instead make sure you call initialiseJuce_GUI() before using any juce classes. As long as your host app is running a normal event loop, you should be ok.
You say you’ve been trying for 3 days, which sounds like you’re in a bit of a muddle… it’s really shouldn’t be that difficult. Maybe try asking us some more detailed questions about what isn’t working for you?
In VC++ Express 10, I have taken the plugin host demo and set it to compile as a DLL and removed the precompiled header entries from the properties of the VC++ 2010 build.
I added a HostStartup.h file with the following code:
[quote=“joshbabier”][quote=“jules”]
Essentially, you just need to drop all the JUCEApplication stuff, and instead make sure you call initialiseJuce_GUI() before using any juce classes. As long as your host app is running a normal event loop, you should be ok.
You say you’ve been trying for 3 days, which sounds like you’re in a bit of a muddle… it’s really shouldn’t be that difficult. Maybe try asking us some more detailed questions about what isn’t working for you?
[/quote]
In VC++ Express 10, I have taken the plugin host demo and set it to compile as a DLL and removed the precompiled header entries from the properties of the VC++ 2010 build.
I added a HostStartup.h file with the following code:
The errors are because you’re using an old version of juce that defines the T macro, and are including windows.h after juce.h. Either get an up-to-date version of juce (I’ve got rid of the old T macro now), or just include windows.h before you include juce.
And your code looks pretty garbled… anything that’s declared as extern “C” cannot have a namespace, or be a method, it has to just be a plain C function.
So I was able to compile the dll after switching the order of Windows.h include.
Then I went on to create a windows app to load the dll. I built it using VC++'s default window app and added in calls to the dll’s startUp and shutDown methods, which in turn call the initialiseJuce_GUI() and shutdownJuce_GUI(), respectively.
The windows app loads the dll and I get the DBG traces for the startUp and shutDown methods but I don’t see any window besides the window of the default window app - no Juce window. There doesn’t seem to be any way that I can actually access the PluginHostApp class or any of it’s methods.
In DllCaller.cpp, I call the startUp method on line 123 and the shutdown method on lines 157 & 171.
You can load both projects from the “audio plugin host As DLL/Builds/VisualStudio2010/Plugin Host As DLL.sln”. Then just build the dll and run the DllCaller.
Any help getting Audio Plugin Host Demo to work as a dll would be greatly appreciated.
Although you might need to redo the Framework and References under the Common Properties tab, to include the Plugin Host As DLL reference. Sorry for the inconvenience.
Like I told you, DO NOT USE the application class. Your code is no longer an app, and that class is meaningless in this context. You’ll need to create your window in response to some kind of DLL function that your host calls.