V
Vachiron
I use a MFC project with OWC chart (VS2005/OWC11).
When i used CChInterior to change background, it works, but i got a ASSERT.
[CODE 1]
CChInterior myInter;
myInter.SetTextured(COleVariant(short(chTexturePapyrus)),chTile,0,chAllFaces);
[CODE 2]
CChInterior myInter;
myInter.SetTextured(COleVariant("C:\\IMG.BMP"),chTile,0,chAllFaces);
The CODE 1 and CODE 2 both change background successfully, but when I close
the MFC Dialog window, the CODE1 is safe, but CODE2 will get a ASSERT.
The Assert is in
\Microsoft Visual Studio 8\VC\atlmfc\src\mfc\cmdtarg.cpp
CCmdTarget::~CCmdTarget()
{
#ifndef _AFX_NO_OLE_SUPPORT
if (m_xDispatch.m_vtbl != 0)
((COleDispatchImpl*)&m_xDispatch)->Disconnect();
ASSERT(m_dwRef <= 1);
#endif
m_pModuleState = NULL;
}
When using CODE2, the m_dwRef=2, ASSERT!
Did i use the SetTextured incorrectly? Could you give me some suggestion?
Thanks.
When i used CChInterior to change background, it works, but i got a ASSERT.
[CODE 1]
CChInterior myInter;
myInter.SetTextured(COleVariant(short(chTexturePapyrus)),chTile,0,chAllFaces);
[CODE 2]
CChInterior myInter;
myInter.SetTextured(COleVariant("C:\\IMG.BMP"),chTile,0,chAllFaces);
The CODE 1 and CODE 2 both change background successfully, but when I close
the MFC Dialog window, the CODE1 is safe, but CODE2 will get a ASSERT.
The Assert is in
\Microsoft Visual Studio 8\VC\atlmfc\src\mfc\cmdtarg.cpp
CCmdTarget::~CCmdTarget()
{
#ifndef _AFX_NO_OLE_SUPPORT
if (m_xDispatch.m_vtbl != 0)
((COleDispatchImpl*)&m_xDispatch)->Disconnect();
ASSERT(m_dwRef <= 1);
#endif
m_pModuleState = NULL;
}
When using CODE2, the m_dwRef=2, ASSERT!
Did i use the SetTextured incorrectly? Could you give me some suggestion?
Thanks.