# Multiple wraped plugin editors inside one component

**URL:** <https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774>\
**Category:** Audio Plugins\
**Created:** [October 26, 2015, 7:56am UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774 "2015-10-26T07:56:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [October 26, 2015, 7:56am UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774/1 "2015-10-26T07:56:57Z")

</div>

I am wrapping multiple plugins inside my plugin (currently&nbsp;Windows version) and&nbsp;I am trying to show their editors at once (without success, as you can expected - it crashes when 2nd editor is displayed). I've read thru&nbsp;several threads in this forum&nbsp;related to this issues and found the reason,&nbsp;but didn't find a solution how to make it work.

There were&nbsp;general solutions suggested like creating heavy weight window or TopLevelWindow for each plugin. Unfortunately i am not very experienced with JUCE, so i am a bit lost how to do it.

Is there maybe someone who has successfully done it ? Does anyone have&nbsp;any ideas, hints, directions, examples of possible solutions ? I would be VERY interested in it and i am sure some other people on this forum&nbsp;would be, too.

Thank you !!!

---

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [October 26, 2015, 4:03pm UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774/2 "2015-10-26T16:03:00Z")

</div>

I am checking code from OpenGL component, which creates native window - i guess this is the right direction ?

\*\*\*

&nbsp;void createNativeWindow (Component& component)

&nbsp; &nbsp; {  
&nbsp; &nbsp; &nbsp; &nbsp; Component\* topComp = component.getTopLevelComponent();  
&nbsp; &nbsp; &nbsp; &nbsp; nativeWindow = createNonRepaintingEmbeddedWindowsPeer (\*dummyComponent, topComp-\>getWindowHandle());

&nbsp; &nbsp; &nbsp; &nbsp; if (ComponentPeer\* peer = topComp-\>getPeer())  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; updateWindowPosition (peer-\>getAreaCoveredBy (component));

&nbsp; &nbsp; &nbsp; &nbsp; nativeWindow-\>setVisible (true);  
&nbsp; &nbsp; &nbsp; &nbsp; dc = GetDC ((HWND) nativeWindow-\>getNativeHandle());  
&nbsp; &nbsp; }  
&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 26, 2015, 4:34pm UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774/3 "2015-10-26T16:34:56Z")

</div>

It's not possible to have multiple editors inside a common parent window - the plugins SDKs were never designed to support that. You'd need to put each one inside its own separate window.

---

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [October 26, 2015, 5:11pm UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774/4 "2015-10-26T17:11:40Z")

</div>

Yes, i am aware it isnt possible with a single parent window.

I've read few times in this forum about creating heavy weight native window for each plugin editor and then display these&nbsp;windows over the JUCE component. This solution was never declared as "not possible", so i am still hoping.

Because of that i am looking at OpenGL code mentioned.&nbsp;

Actually i would like to make a rack of plugins - if every plugin would be in a separate window, it would be impossible to set its position relative to rack and a whole bunch of other problems ...

Just a bit of brainstorming, i guess i am really stuck now :/

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 26, 2015, 5:35pm UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774/5 "2015-10-26T17:35:45Z")

</div>

I don't understand what you're stuck on.. You certainly need to have these in separate windows, but that's not hard and you can do it without needing to do any native hackery. Using OpenGL is likely to break a lot of things though, you should keep that away from any plugin windows.

---

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [October 26, 2015, 5:36pm UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774/6 "2015-10-26T17:36:59Z")

</div>

I was refering to this post (thread) as well:

http://www.juce.com/comment/298651#comment-298651

&nbsp;

---

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [October 26, 2015, 6:00pm UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774/7 "2015-10-26T18:00:05Z")

</div>

I guess&nbsp;you have in mind separate plugin windows like in JUCE Plugin Host ?

Do you suggest implementing virtual rack using&nbsp;separate borderless&nbsp;DocumentWindow&nbsp;for each plugin ?

Thanks for your help !!!

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 26, 2015, 8:28pm UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774/8 "2015-10-26T20:28:11Z")

</div>

Yes, that's the general idea.

---

<div class="post-metadata">

**Author:** ![anthony-nicholls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anthony-nicholls/32/1246_2.png) [@anthony-nicholls](https://forum.juce.com/u/anthony-nicholls)\
**Post date:** [October 26, 2015, 9:51pm UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774/9 "2015-10-26T21:51:11Z")

</div>

Maybe I'm misunderstsnding, but could each of the plugins you're trying to wrap up&nbsp;not just be a regular plugin / dynamic library that becomes a resource of the parent plugin and is loaded as if the parent plugin is a host?&nbsp;I see no reason a plugin can't also be a host.  
  
If needs be they could become part of a static library but that raises several complexities, dynamic libraries would be far easier I suspect.

---

<div class="post-metadata">

**Author:** ![zabukowski](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zabukowski/32/507_2.png) [@zabukowski](https://forum.juce.com/u/zabukowski)\
**Post date:** [October 27, 2015, 8:17am UTC](https://forum.juce.com/t/multiple-wraped-plugin-editors-inside-one-component/15774/10 "2015-10-27T08:17:00Z")

</div>

I can say my plugin is already&nbsp;a host - it loads and handles&nbsp;multiple .dll plugins as expected.

The problem is that my plugin can't show (inside its window) multiple (more than one) hosted&nbsp;plugin's editor at once. If more than one would&nbsp;be displayed, they must live&nbsp;in a separate 'native' top level windows. As i understand now, this is because of JUCE and plugin's SDK design.

The main issue here is&nbsp;that there is no hierarchy (parent/child) established between my plugin and hosted plugins - i would like they all togeteher visually behave as they are one plugin&nbsp;in one window.

On the other side, i have a basic working example of non-JUCE&nbsp;standalone program which is doing the same using Win32 native windows .
