I'm having a bit of a difficulty with the creation of my main dialog window (which is done within the context of a DSP component). Here is what I am doing to create the window :
AfxWinInit(core_api::get_my_instance(), NULL, "", SW_HIDE);
mainWindow = new CMainWindow();
mainWindow->Create((UINT)IDD_ODDCAST, mainApp.GetMainWnd());
//mainWindow->Create((UINT)IDD_ODDCAST, CWnd::FromHandle(core_api::get_main_window()));
//mainWindow->Create((UINT)IDD_ODDCAST, AfxGetMainWnd());
The window is created, however it always stays in front of the foobar2k window. Additionally, in all the child dialogs, you are unable to tab between fields. I'm pretty sure this has something to do with the parent ownership of the Create() call, and so I tried a few other things (they are commented out above). But all of them seem to behave the same way. I use this same technique for the winamp version of my plugin (which behaves properly), and in that case, the line with AfxGetMainWnd() is the right invocation.
In the above case, I'm declaring mainApp as :
CWinApp mainApp;
and CMainWindow is a CDialog.
Any ideas ?