CChInterior class SetTextured got a ASSERT with MFC

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top