tags:

views:

18

answers:

0

I am writing now plugin for FL Studio 9. I have sdk which is intended to work fine with MFC or Win32 Visual C++ 2008 Project. The question is how to make CLR C++ plugin work in Win32 Application in general? I've build the plugin correctly - it is loaded by FL Studio, but only one thing which works is plugin Width and Height properties of WinForm, correctly influences the plugin width and height. The incorrect is method of displaying plugin, namely the plugin has black background, while the WinForm has grey background. I've tried to paint on it, with no effect, it's still black. Sometimes I've got runtime error E0434F4D. Sometimes FL Studio loads plugin, shows two windows: one WinForm and another one for plugin. It depends on code. OK, so here is some code pieces used by my in plugin project: Creating instance of WinForm (Editor):

gcroot<Editor^> editor;
editor = gcnew Editor();

Showing Editor Window where Value is pointer to frame of plugin:

editor->Show(Control::FromHandle(IntPtr(Value)));

In MFC version of plugin everything works fine, but MFC is old, .NET have more powerful features. I think the FL Studio calls some unaccessible methods int this case for drawing plugin. So any idea how to solve this? Thank you in advance for help.