Visual Studio 2005 with SP1 Issue
I have an application which loads the Property Pages from another DLL.
In First Propertypage I have a timer which runs every 5000/1000 mille
seconds and query USB port to find one of the status of unit connected.
If I build this application in Visual Studio 2003 (installed in XP) and run
the binary in Vista it works fine.
If I build this application in VS2005 with SP1 & Vista patch installed in
Vista Machine, I get an assert. When I debug the application, in one place
there is a comment from Microsoft (Windows code)
"Warning: Creating dialog from within a COleControlModule application is not
a supported scenario"
My code as follows
BOOL ToolboxPluginDlg::OnInitDialog()
{
CDialog::OnInitDialog();
DrawDialog();
CToolboxIni theIniCls;
BOOL bRun = (BOOL)(theIniCls.GetNumber(STATUSMONITOR, RUNSTATUSMONITOR, 0,
m_pToolboxCfg->GetPortType(),
m_pToolboxCfg->GetIniFile()
));
SetStatusMonitorRunning(bRun);
if (m_bRunStatusMonitor)
{ m_pStatusMonitor = new CStatusMonitor(IDD_ERROR_DIALOG, m_pToolboxCfg,
m_sPluginSectionName, this);
m_pStatusMonitor->Create(IDD_ERROR_DIALOG, NULL); // this line throws an
assert.
if(m_pToolboxCfg->GetPortType() == PortNetwork)
{
m_pStatusMonitor->Start(5000);
}else
m_pStatusMonitor->Start(1000);
}
return TRUE;
}
The problem looks like VS2005 generated code. If I create Dialog using
DoModal() it works fine.
I am not sure what is the real cause.
Thanks in advance for your help