123
Senior Member
Hopefully some of the Premise gurus are still lurking ...
I've created a native driver for the USBUIRT that works fine provided you don't attempt to create a second instance of it! The moment you do, a "Debug Assertion Failed!" message appears and points to a line within "atlcomcli.h". If I enter debug mode, the offending line is ATLASSERT in this snippet:
My C++ knowledge is insufficient to understand what's going on there ... but I do recognize CoCreateInstance and I use it to create a Timer object within OnBrokerAttach. I copied the technique from the source code for the ALC and Panja drivers.
If I comment out the code above, the resulting USBUIRT driver allows for multiple instances without complaint. If I include the line with "m_DelayTimer.CoCreateInstance", only one instance of a USBUIRT driver is tolerated. I'm stumped. What's preventing the creation of mulitple instances of a timer?
I've created a native driver for the USBUIRT that works fine provided you don't attempt to create a second instance of it! The moment you do, a "Debug Assertion Failed!" message appears and points to a line within "atlcomcli.h". If I enter debug mode, the offending line is ATLASSERT in this snippet:
Code:
__checkReturn HRESULT CoCreateInstance(__in REFCLSID rclsid, __in_opt LPUNKNOWN pUnkOuter = NULL, __in DWORD dwClsContext = CLSCTX_ALL) throw()
{
ATLASSERT(p == NULL);
return ::CoCreateInstance(rclsid, pUnkOuter, dwClsContext, __uuidof(T), (void**)&p);
}
My C++ knowledge is insufficient to understand what's going on there ... but I do recognize CoCreateInstance and I use it to create a Timer object within OnBrokerAttach. I copied the technique from the source code for the ALC and Panja drivers.
Code:
// Set up timer
if ( SUCCEEDED(hr = m_DelayTimer.CoCreateInstance(CLSID_PremiseTimer)) )
{
m_DelayTimer->SetCallback(DELAY_TIMER_ID, this);
m_DelayTimerRunning = FALSE;
}
If I comment out the code above, the resulting USBUIRT driver allows for multiple instances without complaint. If I include the line with "m_DelayTimer.CoCreateInstance", only one instance of a USBUIRT driver is tolerated. I'm stumped. What's preventing the creation of mulitple instances of a timer?