Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen.WaitHostQuiet in C++ -- Fatal Error

Status
Not open for further replies.

ZenToasty

Programmer
Jul 14, 2003
5
US
Visual Studio '97, Win2K, Extra! 6.3, Dell Latittude (et al).

I invoke the Screen.WaitHostQuiet function as so:

-->
try
{
VARIANT vSettleTime;
VariantInit(&vSettleTime);
vSettleTime.vt = VT_I2;
vSettleTime.iVal = nSettleTime;

m_pExtraScreen->WaitHostQuiet(vSettleTime);
}
catch(COleException* pEx)
{
pEx->Delete();
}
-->

My problem is, every once in a while this causes an RPC error, Dr. Watson makes a house call, and everything goes haywire.

Is there a better way to do this? What am I missing?


Thanks,

Zen (Dave)
 
Just an update...

I have discovered that this is a memory leak in EXTRA itself. Even treating m_pExtraScreen->WaitHostQuiet() as an IDispatch and releasing it is not fixing the problem, as so:

VARIANT m_pVarSettleTime;
VariantInit(&m_pVarSettleTime);

COleDispatchDriver *pExtraTemp;

try
{
m_pVarSettleTime.vt = VT_I4;
m_pVarSettleTime.iVal = nSettleTime;
pExtraTemp->AttachDispatch(m_pExtraScreen-WaitHostQuiet(m_pVarSettleTime));
pExtraTemp->ReleaseDispatch();

Sleep(nSettleTime);
}
catch(CException *e)
{
e->Delete();
}

VariantClear(&m_pVarSettleTime);
delete pExtraTemp;

Has anybody had any success with this?

Thanks,

Zen (Dave)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top