Bartlomiej Bazior :

Ok. I've messed with your code and an example vstplug and just when I
thought "success!" a few issues appeared. First here's the code:
http://www.ckmedia.pl/~fev/nuingl/vstplugin.h
http://www.ckmedia.pl/~fev/nuingl/vstplugin.cpp

now everything works fine until I open the editor, load second plugin
instance and open it's editor. In this case I get a crash. But when
for example I load one plugin instance, then the second one, and open
their editors (when the plugins are loaded), there's no crash but the
second editor is screwed (black rectangles instead of fonts). It
propably happens because instead of:

static nglWindow* mpHiddenContext;
static uint mWindowRef;

I used:

nglWindow* mpHiddenContext;
uint mWindowRef;

I did that, because with static declarations I got errors when linking
(I'm slowly getting fed up with that damn linker :-) ):

vstplugin error LNK2001: unresolved external symbol "private: static unsigned int nglVSTSampleEditor::mWindowRef" ([EMAIL PROTECTED]) vstplugin error LNK2001: unresolved external symbol "private: static class nglWindow * nglVSTSampleEditor::mpHiddenContext" ([EMAIL PROTECTED])

Anyway I fired up a debug session (yep, I've finally got it working :-)) to investigate it further, but debug version of vst example is
crashing right after opening the first plugin editor!
The offending part is line 276 of nglcontext.cpp:

  if (!wglShareLists(pShared->mRC, mRC))

Call stack looks morelike this:

vstplugind.dll!nglContext::Build(HWND__ * hWnd=0x00280430, const nglContextInfo & rInfo={...}, const nglContext * pShared=0xcdcdcdcd) Line 276 + 0xd C++ vstplugind.dll!nglWindow::InternalInit(const nglContextInfo & rContext={...}, const nglWindowInfo & rInfo={...}, const nglContext * pShared=0xcdcdcdcd) Line 393 + 0x26 C++ vstplugind.dll!nglWindow::nglWindow(const nglContextInfo & rContext={...}, const nglWindowInfo & rInfo={...}, const nglContext * pShared=0xcdcdcdcd) Line 207 C++ vstplugind.dll!nuiMainWindow::nuiMainWindow(const nglContextInfo & rContextInfo={...}, const nglWindowInfo & rInfo={...}, const nglContext * pShared=0xcdcdcdcd, const nglPath & rResPath={...}) Line 72 + 0x3f C++ vstplugind.dll!nglVSTSampleEditor::open(void * ptr=0x00400468) Line 201 + 0x40 C++


Help! :-)


cheers,
Bart
--
"When the only tool you know is a hammer,
every problem looks like a nail."

Reply via email to