Plugin only shows up occasionally

I wrote a host program based on PluginHost for my Audio Unit plugin (carbon based), and the UI only shows up sporadically. About half of the time, I’m just getting a black screen.
I’m fairly new to Juce and don’t know exactly where I should debug to see what could be going wrong. Maybe a race condition? Why sporadically?
Any suggestions?

Peter

Wrapping a carbon AU in a cocoa app is an incredibly messy process, so not entirely surprising that something might go wrong, but your description’s way too brief to be able to give any useful suggestions…

so I did some additional research, and noticed, that the PluginHost is always displaying my plugin correctly. The difference in my app is, that I am trying to embed the plugin ui in the GraphDocumentComponent, as opposed to creating a new DocumentWindow via the PluginWindow::getWindowFor function. My code looks something like this (called from a GraphDocumentComponent member):
AudioProcessorEditor* ui = 0;
ui = node->processor->createEditorIfNeeded();
if (ui != 0)
{
addAndMakeVisible (ui);
ui->toFront(true);
}

are there any additional steps I have to take in order to make it display correctly there? Or, should I do a different approach? My goal is to have only one window open, and I thought the GraphDocumentComponent would work for that.

Bad idea, unfortunately. It should work fine, but the historically bad design of plugin APIs means that they just aren’t very good at sharing a window with other plugins. You need to embed a UI in its own window for it to be reliable.

So, in order to have only one window (the plugin window) showing, can I put all the graph processing somewhere else? I tried putting it in the PluginHostApp class, but that didn’t work.

I don’t really understand the question. Do the graph processing in whatever class makes sense in terms of the design of your app. Surely that has nothing to do with the windows?