Click here to Skip to main content
15,881,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Loop error Pin
Joe Woodbury21-Feb-06 5:49
professionalJoe Woodbury21-Feb-06 5:49 
GeneralRe: Loop error Pin
Deviantizh21-Feb-06 6:05
Deviantizh21-Feb-06 6:05 
QuestionRe: Loop error Pin
Deviantizh21-Feb-06 6:18
Deviantizh21-Feb-06 6:18 
AnswerRe: Loop error Pin
Joe Woodbury21-Feb-06 7:23
professionalJoe Woodbury21-Feb-06 7:23 
GeneralRe: Loop error Pin
Deviantizh22-Feb-06 2:03
Deviantizh22-Feb-06 2:03 
QuestionModify the color of the scrollbar in Visual C++ Pin
Junyor21-Feb-06 4:50
Junyor21-Feb-06 4:50 
AnswerRe: Modify the color of the scrollbar in Visual C++ Pin
#realJSOP21-Feb-06 7:55
mve#realJSOP21-Feb-06 7:55 
Question((COleDispatchImpl*)&m_xDispatch)->Disconnect() Pin
RobJones21-Feb-06 4:47
RobJones21-Feb-06 4:47 
Hello,
I am using a 3rd party SDK to display inventory of a machine; anyway after using the following code I close my application in debug mode and it throws an ASSERT error (listed below). This looks to me like the object either isn't being destroyed properly or the refrence count is incorrect for what ever reason...

Any ideas?

<code>
IDatabasePtr  ptr	= NULL;
IInventoryPtr inventory = NULL;
int result = 0;

CWaitCursor wait;
try
{
	ptr.CreateInstance(__uuidof(Database), NULL, CLSCTX_INPROC_SERVER);
	result = ptr->SetConnectionString(_bstr_t(strConnectionString));
		
	if (result == 0)
		AfxMessageBox("Database connect failed.");
	else
	{
		try
		{
			inventory.CreateInstance(__uuidof(Inventory), NULL, CLSCTX_INPROC_SERVER);
			inventory->ShowInventoryTree(lComputerIDN);
		}
		catch (_com_error&)
		{
			AfxMessageBox("COM Error: Failed");
		}
	}
}
catch(_com_error&)
{
	AfxMessageBox("COM Error: Failed");
}</code>



Here's the error in debug.

<code>CCmdTarget::~CCmdTarget()
{
#ifndef _AFX_NO_OLE_SUPPORT
	if (m_xDispatch.m_vtbl != 0)
		((COleDispatchImpl*)&m_xDispatch)->Disconnect();
	ASSERT(m_dwRef <= 1); ////////// <---------- HERE
#endif
#ifdef _AFXDLL
	m_pModuleState = NULL;
#endif
}</code>


Whoever said nothing's impossible never tried slamming a revolving door!

-- modified at 11:06 Tuesday 21st February, 2006
QuestionPossible to connect to multiple IE COM models through the ROT? Pin
TClarke21-Feb-06 4:00
TClarke21-Feb-06 4:00 
AnswerRe: Possible to connect to multiple IE COM models through the ROT? Pin
Stephen Hewitt21-Feb-06 11:38
Stephen Hewitt21-Feb-06 11:38 
GeneralRe: Possible to connect to multiple IE COM models through the ROT? Pin
TClarke21-Feb-06 22:45
TClarke21-Feb-06 22:45 
Questionhow get a function instruction length? Pin
HOW WHAT21-Feb-06 2:58
HOW WHAT21-Feb-06 2:58 
QuestionRe: how get a function instruction length? Pin
David Crow21-Feb-06 5:38
David Crow21-Feb-06 5:38 
AnswerRe: how get a function instruction length? Pin
HOW WHAT21-Feb-06 14:46
HOW WHAT21-Feb-06 14:46 
AnswerRe: how get a function instruction length? Pin
Joe Woodbury21-Feb-06 5:52
professionalJoe Woodbury21-Feb-06 5:52 
QuestionMessageBox() change line Pin
blang047721-Feb-06 2:48
blang047721-Feb-06 2:48 
AnswerRe: MessageBox() change line Pin
Russell'21-Feb-06 3:09
Russell'21-Feb-06 3:09 
GeneralRe: MessageBox() change line Pin
blang047721-Feb-06 3:17
blang047721-Feb-06 3:17 
GeneralRe: MessageBox() change line Pin
Russell'21-Feb-06 3:50
Russell'21-Feb-06 3:50 
GeneralRe: MessageBox() change line Pin
blang047721-Feb-06 4:38
blang047721-Feb-06 4:38 
GeneralRe: MessageBox() change line Pin
RobJones21-Feb-06 4:48
RobJones21-Feb-06 4:48 
GeneralRe: MessageBox() change line Pin
blang047721-Feb-06 15:05
blang047721-Feb-06 15:05 
AnswerRe: MessageBox() change line Pin
Alexander M.,21-Feb-06 6:07
Alexander M.,21-Feb-06 6:07 
AnswerRe: MessageBox() change line Pin
Aqueel21-Feb-06 20:16
Aqueel21-Feb-06 20:16 
GeneralRe: MessageBox() change line Pin
ThatsAlok22-Feb-06 3:13
ThatsAlok22-Feb-06 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.