void CStudentInfoView::GetEntry(POSITION pos) { if (pos != NULL) { CStudent* stu = m_StudentList->GetAt(pos); m_Name = stu->m_Name; m_Grade = stu->m_Grade; } else ClearEntry(); UpdateData(FALSE); }
DWORD WINAPI GetDisplayProfileData( struct display_t *pDispEntry, DWORD nMaxInt ) { HKEY hKey; DWORD nFound = 0, i; for( i = 0; i < nMaxInt; i++ ) ClearEntry( pDispEntry + i ); hKey = MyRegOpenKey( HKEY_LOCAL_MACHINE, "Enum" ); nFound = SearchAllSubkeysForDisplays( hKey, pDispEntry, nMaxInt, 0 ); if( hKey ) RegCloseKey( hKey ); return nFound; }
DWORD SearchAllSubkeysForDisplays( HKEY hKey, struct display_t *pDispEntry, DWORD nMaxInt, DWORD nFound ) { DWORD index = 0; HKEY hSubKey; char *name = NULL; char *data = NULL; if( !hKey ) return nFound; if( !(nFound < nMaxInt) ) return nFound; while( name = MyRegEnumKeyMalloc( hKey, index ) ) { nFound = SearchAllSubkeysForDisplays( hSubKey = MyRegOpenKey( hKey, name ), pDispEntry, nMaxInt, nFound ); if( hSubKey ) data = MyRegQueryValueMalloc( hSubKey, "Class", NULL, NULL ); if( data ) { if( strnicmp( data, "Display", 8 ) == 0 ) { free( data ); data = MyRegQueryValueMalloc( hSubKey, "Driver", NULL, NULL ); if( data ) { if( nFound < nMaxInt ) { if( GetDriverSpecs( (pDispEntry + nFound), data ) ) nFound++; else ClearEntry( pDispEntry + nFound ); } free( data ); } } } if( hSubKey ) RegCloseKey( hSubKey ); free( name ); index++; } return nFound; }
void SourceMatchController::SetSrcMatchAsShort(Child &aChild, bool aUseShortAddress) { VerifyOrExit(aChild.IsIndirectSourceMatchShort() != aUseShortAddress); if (aChild.GetIndirectMessageCount() > 0) { ClearEntry(aChild); aChild.SetIndirectSourceMatchShort(aUseShortAddress); AddEntry(aChild); } else { aChild.SetIndirectSourceMatchShort(aUseShortAddress); } exit: return; }
void SourceMatchController::DecrementMessageCount(Child &aChild) { if (aChild.GetIndirectMessageCount() == 0) { otLogWarnMac(GetInstance(), "DecrementMessageCount(child 0x%04x) called when already at zero count.", aChild.GetRloc16()); ExitNow(); } aChild.DecrementIndirectMessageCount(); if (aChild.GetIndirectMessageCount() == 0) { ClearEntry(aChild); } exit: return; }
void detachPcInterrupt( uint8_t pin ) { #if NUMBER_PIN_CHANGE_INTERRUPT_PORTS > 1 uint8_t port; #endif uint8_t bitMask; pcint_entry_p entry; #if NUMBER_PIN_CHANGE_INTERRUPT_PORTS > 1 port = digitalPinToPort( pin ); #endif bitMask = digitalPinToBitMask( pin ); InterruptOff( #if NUMBER_PIN_CHANGE_INTERRUPT_PORTS > 1 port, #endif ~ bitMask ); entry = pcint; for ( uint8_t i=0; i < NUMBER_PIN_CHANGE_INTERRUPT_HANDLERS; ++i ) { uint8_t SaveSREG = SREG; cli(); if ( #if NUMBER_PIN_CHANGE_INTERRUPT_PORTS > 1 (entry->port == port) && #endif ( (entry->changeMask == bitMask) || (entry->risingMask == bitMask) || (entry->fallingMask == bitMask) ) ) { ClearEntry( entry ); } SREG = SaveSREG; ++entry; } }
void detachPcInterrupt( uint8_t pin, void (*callback)(void), uint8_t mode ) { #if NUMBER_PIN_CHANGE_INTERRUPT_PORTS > 1 uint8_t port; #endif uint8_t bitMask; uint8_t changeMask; uint8_t risingMask; uint8_t fallingMask; uint8_t otherMask; pcint_entry_p entry; changeMask = 0; risingMask = 0; fallingMask = 0; #if NUMBER_PIN_CHANGE_INTERRUPT_PORTS > 1 port = digitalPinToPort( pin ); #endif bitMask = digitalPinToBitMask( pin ); switch ( mode ) { case CHANGE: changeMask = bitMask; break; case FALLING: fallingMask = bitMask; break; case RISING: risingMask = bitMask; break; default: return; } otherMask = 0; entry = pcint; for ( uint8_t i=0; i < NUMBER_PIN_CHANGE_INTERRUPT_HANDLERS; ++i ) { uint8_t SaveSREG = SREG; cli(); #if NUMBER_PIN_CHANGE_INTERRUPT_PORTS > 1 if ( (entry->port == port) ) #endif { if ( (callback == entry->callback) && (changeMask == entry->changeMask) && (risingMask == entry->risingMask) && (fallingMask == entry->fallingMask) ) { ClearEntry( entry ); } else { otherMask |= entry->changeMask | entry->risingMask | entry->fallingMask; } } SREG = SaveSREG; ++entry; } if ( (otherMask & bitMask) == 0 ) { InterruptOff( #if NUMBER_PIN_CHANGE_INTERRUPT_PORTS > 1 port, #endif ~ bitMask ); } }
void SourceMatchController::ResetMessageCount(Child &aChild) { aChild.ResetIndirectMessageCount(); ClearEntry(aChild); }
void CStudentInfoView::OnBnClickedClear() { MYTRACE("Enter"); ClearEntry(); }