I am working on an existing VST plugin that is using MFC on windows to use JUCE as UI. The current plugin has all the code derived from AudioEffectX and AEffEditor. So i am not touching that part to port over to Juce Audio plugin framework.
What i want to do is create component derived window and put the gui controls in there in AEffeditor::open method. The problem is Paint(Graphics& g) is not called for that component when i load the plugin. Is there something i am missing to initialize ?
Here is what i did:
I added code in DllMain to set the plugin instance and call juce_initializeGUI() and corresponding shutdown when dll unloads.
Here is what i added in
CPlugInDlg* pComp = new CPlugInDlg(NULL, NULL, m_pPlug);
pComp->setTopLeftPosition (0, 0);
HWND hostWindow = (HWND) ptr; HWND editorWnd = (HWND) pComp->getWindowHandle(); SetParent (editorWnd, hostWindow); DWORD val = GetWindowLong (editorWnd, GWL_STYLE); val = (val & ~WS_POPUP) | WS_CHILD; SetWindowLong (editorWnd, GWL_STYLE, val); pComp->setVisible (true);
The part of code that calls addToDesktop() and then changes the style i took it from Juce AudioPlugin framework.
Appreciate if you could let me know what i am doing wrong.