/////////////////////////////////////////////////////////////////////////////// // OnTimer void XComboList::OnTimer(UINT nIDEvent) { UNUSED_ALWAYS(nIDEvent); if (!::IsWindow(m_ListBox.m_hWnd)) return; // get current mouse position POINT point; ::GetCursorPos(&point); ScreenToClient(&point); BOOL bOutside; int nIndex = m_ListBox.ItemFromPoint(point, bOutside); //TRACE(" nIndex=%d bOutside=%d\n", nIndex, bOutside); if (!bOutside) { int nCurSel = m_ListBox.GetCurSel(); if (nIndex != nCurSel) if (nIndex >= 0 && nIndex < m_ListBox.GetCount()) m_ListBox.SetCurSel(nIndex); } }
static void SetupDefaultCaps(AM_MEDIA_TYPE* pmt, VIDEO_STREAM_CONFIG_CAPS& caps) { memset(&caps, 0, sizeof(caps)); if (!pmt) { return; } VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)pmt->pbFormat; UNUSED_ALWAYS(vih); BITMAPINFOHEADER* bih = (pmt->formattype == FORMAT_VideoInfo) ? &((VIDEOINFOHEADER*)pmt->pbFormat)->bmiHeader : (pmt->formattype == FORMAT_VideoInfo2) ? &((VIDEOINFOHEADER2*)pmt->pbFormat)->bmiHeader : NULL; caps.guid = GUID_NULL; caps.VideoStandard = 0; caps.InputSize.cx = bih->biWidth; caps.InputSize.cy = abs(bih->biHeight); caps.MinCroppingSize = caps.MaxCroppingSize = caps.InputSize; caps.CropGranularityX = caps.CropGranularityY = 1; caps.CropAlignX = caps.CropAlignY = 1; caps.MinOutputSize = CSize(64, 64); caps.MaxOutputSize = CSize(768, 576); caps.OutputGranularityX = 16; caps.OutputGranularityY = 1; caps.StretchTapsX = caps.StretchTapsY = 0; caps.ShrinkTapsX = caps.ShrinkTapsY = 0; caps.MinFrameInterval = 100000i64; caps.MaxFrameInterval = 100000000i64; caps.MinBitsPerSecond = caps.MaxBitsPerSecond = 0; }
void CIfo::RemovePgciUOPs (uint8_t *ptr) { ifo_hdr_t* hdr = (ifo_hdr_t *) ptr; uint16_t num; int i; ptr += IFO_HDR_LEN; num = be2me_16(hdr->num); for (i=1; i<=num; i++) { lu_sub_t *lu_sub = (lu_sub_t *) ptr; UNUSED_ALWAYS(lu_sub); ptr += LU_SUB_LEN; } for (i=0; i<be2me_16(hdr->num); i++) { uint8_t *ptr; if (GetMiscPGCI (hdr, i, &ptr) >= 0) { pgc_t* pgc = (pgc_t*) ptr; pgc->prohibited_ops = 0; } } }
ItemIntegerType CCellView::GetCellValue() const { // If the item is being edited in-cell, we'll get the data from the control ItemIntegerType rc=0; switch(TI(m_hInCell).Type()){ case CConfigItem::Integer: { CString strData; m_pwndCell->GetWindowText(strData); if(!CUtils::StrToItemIntegerType(strData,rc)){ rc=0; } } break; case CConfigItem::Enum: /* case CConfigItem::Boolean: case CConfigItem::Radio: //rc=((CTreeComboBox *)m_pwndCell)->GetCurSel(); rc=((CComboEdit *)m_pwndCell)->GetCurSel(); break; */ case CConfigItem::String: default: int type=TI(m_hInCell).Type(); UNUSED_ALWAYS(type); ASSERT(FALSE); break; } return rc; }
/** Processes a file, if it contains valuable commands. The file is loaded into a buffer a is passed to <it>ParseBuffer</it>, where all commands will be extracted. */ void CStyleFile::ProcessFile() { CFile f; try { f.Open(m_Filename, CFile::modeRead); ULONGLONG l = f.GetLength(); CString text; f.Read(text.GetBuffer(l), l * sizeof(TCHAR)); text.ReleaseBuffer(); if (HasCommands(text)) { ParseBuffer(text); } } catch (CFileException& ex) { TRACE(_T("Error opening style file: %s\n"), ex); UNUSED_ALWAYS(ex); f.Close(); } f.Close(); }
/////////////////////////////////////////////////////////////////////////////// // ReportError void CXHyperLink::ReportError(int nError) { #ifdef XHYPERLINK_REPORT_ERROR CString str; switch (nError) { case 0: str = "The operating system is out\nof memory or resources."; break; case SE_ERR_PNF: str = "The specified path was not found."; break; case SE_ERR_FNF: str = "The specified file was not found."; break; case ERROR_BAD_FORMAT: str = "The .EXE file is invalid\n(non-Win32 .EXE or error in .EXE image)."; break; case SE_ERR_ACCESSDENIED: str = "The operating system denied\naccess to the specified file."; break; case SE_ERR_ASSOCINCOMPLETE: str = "The filename association is\nincomplete or invalid."; break; case SE_ERR_DDEBUSY: str = "The DDE transaction could not\nbe completed because other DDE transactions\nwere being processed."; break; case SE_ERR_DDEFAIL: str = "The DDE transaction failed."; break; case SE_ERR_DDETIMEOUT: str = "The DDE transaction could not\nbe completed because the request timed out."; break; case SE_ERR_DLLNOTFOUND: str = "The specified dynamic-link library was not found."; break; case SE_ERR_NOASSOC: str = "There is no application associated\nwith the given filename extension."; break; case SE_ERR_OOM: str = "There was not enough memory to complete the operation."; break; case SE_ERR_SHARE: str = "A sharing violation occurred. "; default: str.Format(_T("Unknown Error (%d) occurred."), nError); break; } str = "Unable to open hyperlink:\n\n" + str; AfxMessageBox(str, MB_ICONEXCLAMATION | MB_OK); #else UNUSED_ALWAYS(nError); #endif // XHYPERLINK_REPORT_ERROR }
// シェーダごとの初期化 BOOL CPhongShader::InitInternal(izanagi::graph::CGraphicsDevice* pDevice) { UNUSED_ALWAYS(pDevice); IZ_ASSERT(m_pEffect != IZ_NULL); if (!GetCommonParameterHandles()) { return IZ_FALSE; } static const char* PARAM_NAME[] = { "g_vEye", "g_vMtrlDiffuse", "g_vMtrlAmbient", "g_vMtrlSpecular", "g_vLitParallelDir", "g_vLitParallelColor", "g_vLitAmbientColor", }; C_ASSERT(COUNTOF(PARAM_NAME) == HANDLE_NUM); IZ_BOOL result = GetParameterByName( HANDLE_NUM, m_hHandles, PARAM_NAME); IZ_ASSERT(result); return result; }
BOOL WINAPI RawDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID) { UNUSED_ALWAYS(hInstance); if (dwReason == DLL_PROCESS_ATTACH) { // Prevent the MFC DLL from being unloaded prematurely LoadLibraryA(MFC42_DLL); // make sure we have enough memory to attempt to start (8kb) void* pMinHeap = LocalAlloc(NONZEROLPTR, 0x2000); if (pMinHeap == NULL) return FALSE; // fail if memory alloc fails LocalFree(pMinHeap); // save critical data pointers before running the constructors AFX_MODULE_STATE* pModuleState = AfxGetModuleState(); pModuleState->m_pClassInit = pModuleState->m_classList; pModuleState->m_pFactoryInit = pModuleState->m_factoryList; pModuleState->m_classList.m_pHead = NULL; pModuleState->m_factoryList.m_pHead = NULL; } else if (dwReason == DLL_PROCESS_DETACH) { // Now it's OK for the MFC DLL to be unloaded (see LoadLibrary above) FreeLibrary(GetModuleHandleA(MFC42_DLL)); } return TRUE; // ok }
void CHdmvSub::ParseObject(CGolombBuffer* pGBuffer, USHORT nUnitSize) // #498 { SHORT object_id = pGBuffer->ReadShort(); UNUSED_ALWAYS(object_id); BYTE m_sequence_desc; ASSERT (m_pCurrentObject != NULL); if (m_pCurrentObject) { // && m_pCurrentObject->m_object_id_ref == object_id) m_pCurrentObject->m_version_number = pGBuffer->ReadByte(); m_sequence_desc = pGBuffer->ReadByte(); if (m_sequence_desc & 0x80) { DWORD object_data_length = (DWORD)pGBuffer->BitRead(24); m_pCurrentObject->m_width = pGBuffer->ReadShort(); m_pCurrentObject->m_height = pGBuffer->ReadShort(); m_pCurrentObject->SetRLEData (pGBuffer->GetBufferPos(), nUnitSize-11, object_data_length-4); TRACE_HDMVSUB ("CHdmvSub:NewObject size=%ld, total obj=%d, %dx%d\n", object_data_length, m_pObjects.GetCount(), m_pCurrentObject->m_width, m_pCurrentObject->m_height); } else { m_pCurrentObject->AppendRLEData (pGBuffer->GetBufferPos(), nUnitSize-4); } } }
CString CSDMdlMachBendRadiusCheck::CheckResultDesc(int nResult, const CheckData &checkData) { UNUSED_ALWAYS(checkData); CString strResultDesc = L""; switch(nResult) { case CHECK_RESULT_NO_ERROR: strResultDesc = L"折弯半径与板厚的比值符合要求"; break; case CHECK_RESULT_INVALID_INPUT: strResultDesc = L"输入值不合理"; break; case CHECK_RESULT_INVALID_VALUE: strResultDesc = L"折弯半径与板厚比值不符合要求"; break; case CHECK_RESULT_INVALID_MODEL: strResultDesc = L"模型非钣金件"; break; default: break; } return strResultDesc; }
BOOL CFileFind::FindFile(LPCTSTR pstrName /* = NULL */, DWORD dwUnused /* = 0 */) { UNUSED_ALWAYS(dwUnused); Close(); m_pNextInfo = new WIN32_FIND_DATA; m_bGotLast = FALSE; if (pstrName == NULL) pstrName = _T("*.*"); lstrcpy(((WIN32_FIND_DATA*) m_pNextInfo)->cFileName, pstrName); m_hContext = ::FindFirstFile(pstrName, (WIN32_FIND_DATA*) m_pNextInfo); if (m_hContext == INVALID_HANDLE_VALUE) { DWORD dwTemp = ::GetLastError(); Close(); ::SetLastError(dwTemp); return FALSE; } LPTSTR pstrRoot = m_strRoot.GetBufferSetLength(_MAX_PATH); LPCTSTR pstr = _tfullpath(pstrRoot, pstrName, _MAX_PATH); // passed name isn't a valid path but was found by the API ASSERT(pstr != NULL); if (pstr == NULL) { m_strRoot.ReleaseBuffer(-1); Close(); ::SetLastError(ERROR_INVALID_NAME); return FALSE; } else { // find the last forward or backward whack LPTSTR pstrBack = _tcsrchr(pstrRoot, '\\'); LPTSTR pstrFront = _tcsrchr(pstrRoot, '/'); if (pstrFront != NULL || pstrBack != NULL) { if (pstrFront == NULL) pstrFront = pstrRoot; if (pstrBack == NULL) pstrBack = pstrRoot; // from the start to the last whack is the root if (pstrFront >= pstrBack) *pstrFront = '\0'; else *pstrBack = '\0'; } m_strRoot.ReleaseBuffer(-1); } return TRUE; }
void CEditView::OnPrepareDC( CDC *pDC, CPrintInfo *pInfo ) /********************************************************/ { UNUSED_ALWAYS( pDC ); if( pInfo != NULL && pInfo->m_nCurPage > m_aPageStart.GetCount() ) { pInfo->m_bContinuePrinting = FALSE; } }
BOOL CFlickerFreeTree::OnEraseBkgnd(CDC* pDC) { // TODO: Add your message handler code here and/or call default UNUSED_ALWAYS(pDC); //return CTreeCtrl::OnEraseBkgnd(pDC); return TRUE; }
LRESULT CRunTestsSheet::OnTestOutput(WPARAM wParam, LPARAM lParam) { UNUSED_ALWAYS(lParam); LPTSTR psz=(LPTSTR)wParam; outputpage.AddText(psz); delete [] psz; return 0; }
void CHtmlView::OnNewWindow2(LPDISPATCH* ppDisp, BOOL* bCancel) { // default to continuing bCancel = FALSE; // user will override to handle this notification UNUSED_ALWAYS(ppDisp); }
bool PropPageGeneral::OnProgress (/*[in]*/ unsigned level, /*[in]*/ const char * lpszDirectory) { UNUSED_ALWAYS (level); pProgressDialog->SetLine (2, lpszDirectory); return (! pProgressDialog->HasUserCancelled()); }
void CExportKeygen::Save(xmlNodePtr node) { UNUSED_ALWAYS(node); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("Keygen.Export.StyleFile"), m_StyleFile); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("Keygen.Export.Encoding"), m_Encoding); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("Keygen.Export.Ext"), m_Ext); AfxGetApp()->WriteProfileString(SETTINGS_KEY, _T("Keygen.Export.Filter"), m_Filter); }
void CHtmlView::DocumentComplete(LPDISPATCH pDisp, VARIANT* URL) { UNUSED_ALWAYS(pDisp); ASSERT(V_VT(URL) == VT_BSTR); CString str(V_BSTR(URL)); OnDocumentComplete(str); }
// old creation method, still here for compatibility reasons BOOL CSizingControlBar::Create(LPCTSTR lpszWindowName, CWnd* pParentWnd, CSize sizeDefault, BOOL bHasGripper, UINT nID, DWORD dwStyle) { UNUSED_ALWAYS(bHasGripper); m_szHorz = m_szVert = m_szFloat = sizeDefault; return Create(lpszWindowName, pParentWnd, nID, dwStyle); }
/** * @fn Comment * Function Comments * @param CString &rComment: represents the comment string * @param DWORD dwAppData: represents the open file * @param bool bAbort: represents if the parser is aborted * This function defines the comments for the tags */ void FSMReader::Comment(const CString &rComment, DWORD dwAppData, bool &bAbort) { #ifdef FSM_DEBUG //Class HTML_FSM Parser Debug activated LogFile << "Comments: " << rComment << std::endl; #endif UNUSED_ALWAYS(dwAppData); bAbort = false; }
void CLanguageReader::BeginParse(DWORD dwAppData, bool &bAbort) { UNUSED_ALWAYS(dwAppData); bAbort = false; #ifdef CLaP_DEBUG //Class HTML Parser Debug activated LogFile << "LANGUAGE PARSER: BEGIN PARSE.\n"; #endif }
LRESULT CFrameWnd::OnDDETerminate( WPARAM wParam, LPARAM lParam ) /***************************************************************/ { UNUSED_ALWAYS( lParam ); HWND hWndClient = (HWND)wParam; ::PostMessage( hWndClient, WM_DDE_TERMINATE, (WPARAM)m_hWnd, 0L ); return( 0L ); }
ProError CSDMdlSpecMdlRelationCheck::SolidRelsetVisit(ProRelset* pRelset, ProAppData app_data) { UNUSED_ALWAYS(app_data); ProError status; status = ProRelsetRegenerate(pRelset); if (status != PRO_TK_NO_ERROR) return PRO_TK_USER_ABORT; return PRO_TK_NO_ERROR; }
BOOL COleFrameHook::OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu) { UNUSED_ALWAYS(nFlags); UNUSED_ALWAYS(nItemID); // if we're over a docobject item, we need to reflect messages COleDocObjectItem* pActiveDocObjectItem = DYNAMIC_DOWNCAST(COleDocObjectItem, m_pActiveItem); if (pActiveDocObjectItem != NULL) { CWnd* pWnd = pActiveDocObjectItem->GetInPlaceWindow(); // if we're popping up a menu, figure out what menu is // apparing; if it's in the help menu and it's not the // first element, it's the object's menu. if (nFlags & MF_POPUP) { if (pActiveDocObjectItem->m_pHelpPopupMenu->GetSafeHmenu() == hSysMenu) { pActiveDocObjectItem->m_bInHelpMenu = (nItemID != 0); if (pActiveDocObjectItem->m_bInHelpMenu && pWnd != NULL) { pWnd->SendMessage(WM_MENUSELECT, MAKEWPARAM(nItemID, nFlags), (LPARAM) hSysMenu); return TRUE; } } } else { if (pActiveDocObjectItem->m_bInHelpMenu && pWnd != NULL) { pWnd->SendMessage(WM_MENUSELECT, MAKEWPARAM(nItemID, nFlags), (LPARAM) hSysMenu); return TRUE; } } } return FALSE; }
void CSizingControlBar::OnNcLButtonDown(UINT nHitTest, CPoint point) { UNUSED_ALWAYS(point); if (m_bTracking || IsFloating()) return; if ((nHitTest >= HTSIZEFIRST) && (nHitTest <= HTSIZELAST)) StartTracking(nHitTest, point); // sizing edge hit }
void CSizingControlBarG::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler) { UNUSED_ALWAYS(bDisableIfNoHndler); UNUSED_ALWAYS(pTarget); if (!HasGripper()) return; BOOL bNeedPaint = FALSE; CPoint pt; ::GetCursorPos(&pt); BOOL bHit = (OnNcHitTest(pt) == HTCLOSE); BOOL bLButtonDown = (::GetKeyState(VK_LBUTTON) < 0); BOOL bWasPushed = m_biHide.bPushed; m_biHide.bPushed = bHit && bLButtonDown; BOOL bWasRaised = m_biHide.bRaised; m_biHide.bRaised = bHit && !bLButtonDown; bNeedPaint |= (m_biHide.bPushed ^ bWasPushed) || (m_biHide.bRaised ^ bWasRaised); // MDM // Now the max button. if ( m_bUseMaxButton ) { bHit = (OnNcHitTest(pt) == HTMAXBUTTON); bWasPushed = m_btnMax.bPushed; m_btnMax.bPushed = bHit && bLButtonDown; bWasRaised = m_btnMax.bRaised; m_btnMax.bRaised = bHit && !bLButtonDown; bNeedPaint |= (m_btnMax.bPushed ^ bWasPushed) || (m_btnMax.bRaised ^ bWasRaised); } if (bNeedPaint) SendMessage(WM_NCPAINT); }
/** * @fn BeginParse * @param DWORD dwAppData: represents the open file * @param bool bAbort: represents if the parser is aborted * This function starts the debugger parser */ void FSMReader::BeginParse(DWORD dwAppData, bool &bAbort) { UNUSED_ALWAYS(dwAppData); bAbort = false; #ifdef FSM_DEBUG //Class HTML_FSM Parser Debug activated LogFile << CP_ParserMsgs[LOG_STARTING_INTERPRETATION] << "\n"; #endif ResetState(); //Stack reset StateStack.push(NIL_FSM); }
void SiteWizRemote::OnItemSelection (/*[in]*/ NMHDR * pNMHDR, /*[in]*/ LRESULT * pResult) { UNUSED_ALWAYS (pNMHDR); CPropertySheet * pSheet = reinterpret_cast<CPropertySheet*>(GetParent()); ASSERT_KINDOF (CPropertySheet, pSheet); pSheet->SetWizardButtons (PSWIZB_BACK | PSWIZB_FINISH); *pResult = 0; }
void ChooserDialog::OnDomainListChanged( NMHDR *pNMHDR, LRESULT *pResult ) { UNUSED_ALWAYS( pNMHDR ); // Domain list changes have similar effects to service list changes so reuse that code path by calling it here. OnServiceListChanged( NULL, NULL ); *pResult = 0; }
LRESULT CControlBar::OnSizeParent( WPARAM wParam, LPARAM lParam ) /***************************************************************/ { UNUSED_ALWAYS( wParam ); if( GetStyle() & WS_VISIBLE ) { AFX_SIZEPARENTPARAMS *pSPP = (AFX_SIZEPARENTPARAMS *)lParam; ASSERT( pSPP != NULL ); DWORD nMode = 0L; if( m_dwStyle & CBRS_ORIENT_HORZ ) { nMode |= LM_HORZ; } if( pSPP->bStretch ) { nMode |= LM_STRETCH; } CSize size = CalcDynamicLayout( -1, nMode ); CRect rect; if( m_dwStyle & CBRS_ALIGN_LEFT ) { rect.left = pSPP->rect.left; rect.top = pSPP->rect.top; rect.right = pSPP->rect.left + size.cx; rect.bottom = min( pSPP->rect.top + size.cy, pSPP->rect.bottom ); pSPP->rect.left += size.cx; pSPP->sizeTotal.cx += size.cx; pSPP->sizeTotal.cy = max( pSPP->sizeTotal.cy, size.cy ); } else if( m_dwStyle & CBRS_ALIGN_RIGHT ) { rect.left = pSPP->rect.right - size.cx; rect.top = pSPP->rect.top; rect.right = pSPP->rect.right; rect.bottom = min( pSPP->rect.top + size.cy, pSPP->rect.bottom ); pSPP->rect.right -= size.cx; pSPP->sizeTotal.cx += size.cx; pSPP->sizeTotal.cy = max( pSPP->sizeTotal.cy, size.cy ); } else if( m_dwStyle & CBRS_ALIGN_BOTTOM ) { rect.left = pSPP->rect.left; rect.top = pSPP->rect.bottom - size.cy; rect.right = min( pSPP->rect.left + size.cx, pSPP->rect.right ); rect.bottom = pSPP->rect.bottom; pSPP->rect.bottom -= size.cy; pSPP->sizeTotal.cx = max( pSPP->sizeTotal.cx, size.cx ); pSPP->sizeTotal.cy += size.cy; } else { rect.left = pSPP->rect.left; rect.top = pSPP->rect.top; rect.right = min( pSPP->rect.left + size.cx, pSPP->rect.right ); rect.bottom = pSPP->rect.top + size.cy; pSPP->rect.top += size.cy; pSPP->sizeTotal.cx = max( pSPP->sizeTotal.cx, size.cx ); pSPP->sizeTotal.cy += size.cy; } AfxRepositionWindow( pSPP, m_hWnd, &rect ); } return( 0L ); }