// Resizes all the gadgets in an array to match the new size. // Generally called from an OnSize routine (or the like) void ResizeGadgetsOnWindow(GADGETRESIZEHANDLE Handle, int cx, int cy) { CPtrArray* pArray = (CPtrArray*)Handle; if (pArray == NULL || cx == 0 || cy == 0) return; ASSERT(pArray->GetSize() > 0); // must be at least one element in the array // if auto-sizing, go thru and reposition all the controls. CSize sizeWndOrig = ((RECT_AND_HWND*)pArray->GetAt(0))->m_rect.Size(); for (int i = 1; i < pArray->GetSize(); i++) { RECT_AND_HWND* pRectWnd = (RECT_AND_HWND*)pArray->GetAt(i); CRect newRect = pRectWnd->m_rect; CSize sizeCtlOrig = newRect.Size(); newRect.top = newRect.top * cy / sizeWndOrig.cy; newRect.left = newRect.left * cx / sizeWndOrig.cx; newRect.right = newRect.right * cx / sizeWndOrig.cx; // if bottom is < 0, then kepp it fixed height - used for combo boxes // where we don't really want to resize most of them... if (newRect.bottom < 0) newRect.bottom = newRect.top - newRect.bottom; else newRect.bottom = newRect.bottom * cy / sizeWndOrig.cy; ::SetWindowPos(pRectWnd->m_hWnd, NULL, newRect.left, newRect.top, newRect.Width(), newRect.Height(), SWP_NOZORDER); } }
char *ShaderNameLookup(patchMesh_t *patch) { int i; int count = PatchShaders.GetSize(); for(i=0; i<count; i++) { if (static_cast<patchEntry_t*>(PatchShaders.GetAt(i))->p == patch) return static_cast<patchEntry_t*>(PatchShaders.GetAt(i))->name; } Sys_Printf("ERROR: failed to lookup name in ShaderNameLookup??\n"); return "radiant/notex"; }
char *ShaderNameLookup( patchMesh_t * patch ){ int i; int count = PatchShaders.GetSize(); for ( i = 0; i < count; i++ ) { if ( static_cast < patchEntry_t * >( PatchShaders.GetAt( i ) )->p == patch ) { return static_cast < patchEntry_t * >( PatchShaders.GetAt( i ) )->name; } } Sys_FPrintf( SYS_ERR, "ERROR: failed to lookup name in ShaderNameLookup??\n" ); return const_cast<char*>(SHADER_NOT_FOUND); }
void CedExporter::RecordLocations(const CePoint& p, CMapPtrToPtr& locIndex) { //CString s; //s.Format("Process point %s", p.FormatKey()); //Log(s); //FILE* log = 0; //if (p.FormatKey() == "2632804") // log = LogFile; CPtrArray locs; const CeLocation* loc = p.GetpVertex(); GetAllCoincidentLocations(loc, locs, LogFile); //if (locs.GetSize() != 1) //{ // CString s; // s.Format("%d locs", locs.GetSize()); // Log(s); //} for (int i=0; i<locs.GetSize(); i++) { void* pLoc = locs.GetAt(i); locIndex.SetAt(pLoc, 0); } }
void CSfxModel::SetFrame(float currentFrame) { if (currentFrame == m_currentFrame || currentFrame < 0.0f) return; if (currentFrame < m_currentFrame) { CPtrArray<Particle>* particles; int j; for (int i = 0; i < m_particles.GetSize(); i++) { particles = m_particles[i]; if (particles) { for (j = 0; j < particles->GetSize(); j++) Delete(particles->GetAt(j)); particles->RemoveAll(); } } m_currentFrame = -0.5f; } while (currentFrame > m_currentFrame) { if (!_nextFrame()) break; } if (m_currentFrame < 0.0f) m_currentFrame = 0.0f; }
CG2Neighbour* CNeighboursWithG2::GetRandomHub(CG2Neighbour* pExcept, GGUID* pGUID) { CPtrArray pRandom; for ( POSITION pos = GetIterator() ; pos ; ) { CG2Neighbour* pNeighbour = (CG2Neighbour*)GetNext( pos ); if ( pNeighbour->m_nState == nrsConnected && pNeighbour->m_nProtocol == PROTOCOL_G2 && pNeighbour->m_nNodeType != ntLeaf && pNeighbour != pExcept ) { if ( pNeighbour->m_pGUIDCache->Lookup( pGUID ) == NULL ) { pRandom.Add( pNeighbour ); } } } int nSize = pRandom.GetSize(); if ( ! nSize ) return NULL; nSize = rand() % nSize; return (CG2Neighbour*)pRandom.GetAt( nSize ); }
bool DispatchOnLButtonUp( guint32 nFlags, int x, int y ){ for ( int i = 0; i < l_WindowListeners.GetSize(); i++ ) if ( static_cast<IWindowListener*>( l_WindowListeners.GetAt( i ) )->OnLButtonUp( nFlags, x, y ) ) { return true; } return false; }
void Entity_XMLWrite( entity_t *pEntity, xmlNodePtr entity ){ brush_t *pBrush; epair_t *pEpair; xmlNodePtr node; CPtrArray *brushes = (CPtrArray*)pEntity->pData; for ( pEpair = pEntity->epairs; pEpair != NULL; pEpair = pEpair->next ) { node = xmlNewChild( entity, NULL, (xmlChar *)"epair", NULL ); Epair_XMLWrite( pEpair, node ); } for ( int i = 0; i < brushes->GetSize(); i++ ) { pBrush = (brush_t*)brushes->GetAt( i ); if ( pBrush->patchBrush ) { node = xmlNewChild( entity, NULL, (xmlChar *)"patch", NULL ); Patch_XMLWrite( pBrush->pPatch, node ); } else { node = xmlNewChild( entity, NULL, (xmlChar *)"brush", NULL ); Brush_XMLWrite( pBrush, node ); } } }
LRESULT CRegNewUserDlg::OnCompanyInfoRslt(WPARAM wParam, LPARAM lParam) { m_cbCompany.DeleteAllItem(); CPtrArray* pArray = (CPtrArray*)lParam; for(int i = 0; i < pArray->GetSize(); i++) { CString strName; CString strCode; SCOMBO_INFO *pData = static_cast<SCOMBO_INFO*>(pArray->GetAt(i)); strName = pData->m_strCodeName; strCode += pData->m_strCode; strCode += IDMSCOMBOBOX_DELIM; m_cbCompany.AddItem(strName, strCode); } m_cbCompany.SetCurSel(0); m_cbCompany.SetCode(m_strCompany); // Clear for(int j = 0; j < pArray->GetSize(); j++) { SCOMBO_INFO *pData = static_cast<SCOMBO_INFO*>(pArray->GetAt(j)); if(pData != NULL) { delete pData; } } delete pArray; UpdateData(FALSE); // 소속 -> TEAM. (CODE_NAME, CODE) TRACEX("RAWSQL_TEAM 요청!\n"); CString strQuery = GetQueryTeam(m_cbCompany.GetCode()); if(CChatSession::Instance().RequestRawSQL(RAWSQL_TEAM, (LPCSTR)strQuery, strlen((LPCSTR)strQuery) ) != TRUE) { return FALSE; } return TRUE; }
void FifthCKF::FifthCKFDelete(CPtrArray &X) { #pragma omp parallel for for (int i = 0; i < X.GetSize(); ++i) { delete (StoreData *)X.GetAt(i); } X.RemoveAll(); }
/* ============ Select_Ray If the origin is inside a brush, that brush will be ignored. ============ */ void Select_Ray( vec3_t origin, vec3_t dir, int flags ) { trace_t t; t = Test_Ray( origin, dir, flags ); if ( !t.brush ) return; if ( flags == SF_SINGLEFACE ) { int nCount = g_SelectedFaces.GetSize(); bool bOk = true; for ( int i = 0; i < nCount; i++ ) { if ( t.face == reinterpret_cast<face_s*>( g_SelectedFaces.GetAt( i ) ) ) { bOk = false; // need to move remove i'th entry g_SelectedFaces.RemoveAt( i, 1 ); g_SelectedFaceBrushes.RemoveAt( i, 1 ); } } if ( bOk ) { g_SelectedFaces.Add( t.face ); g_SelectedFaceBrushes.Add( t.brush ); } //selected_face = t.face; //selected_face_brush = t.brush; Sys_UpdateWindows( W_ALL ); clearSelection(); // Texture_SetTexture requires a brushprimit_texdef fitted to the default width=2 height=2 texture brushprimit_texdef_s brushprimit_texdef; ConvertTexMatWithQTexture( &t.face->brushprimit_texdef, t.face->d_texture, &brushprimit_texdef, NULL ); Texture_SetTexture( &t.face->texdef, &brushprimit_texdef, false, false ); UpdateSurfaceDialog(); return; } // move the brush to the other list clearSelection(); if ( t.selected ) { Brush_RemoveFromList( t.brush ); Brush_AddToList( t.brush, &active_brushes ); UpdatePatchInspector(); } else { Select_Brush( t.brush, !( GetKeyState( VK_MENU ) & 0x8000 ) ); } Sys_UpdateWindows( W_ALL ); }
// deletes the underlying array and it's elements void DestroyGadgetResizeHandle(GADGETRESIZEHANDLE Handle) { CPtrArray* pArray = (CPtrArray*)Handle; if (pArray != NULL) { for (int i = pArray->GetUpperBound(); i >= 0; i--) delete ((RECT_AND_HWND*)pArray->GetAt(i)); delete pArray; } }
//직급 LRESULT CRegNewUserDlg::OnClassInfoRslt(WPARAM wParam, LPARAM lParam) { m_cbGrade.DeleteAllItem(); CPtrArray* pArray = (CPtrArray*)lParam; for(int i = 0; i < pArray->GetSize(); i++) { CString strName; CString strCode; SCOMBO_INFO *pData = static_cast<SCOMBO_INFO*>(pArray->GetAt(i)); strName = pData->m_strCodeName; strCode += pData->m_strCode; strCode += IDMSCOMBOBOX_DELIM; m_cbGrade.AddItem(strName, strCode); } m_cbGrade.SetCurSel(0); m_cbGrade.SetCode(m_strGrade); // Clear for(int j = 0; j < pArray->GetSize(); j++) { SCOMBO_INFO *pData = static_cast<SCOMBO_INFO*>(pArray->GetAt(j)); if(pData != NULL) { delete pData; } } delete pArray; UpdateData(FALSE); return TRUE; }
void WINAPI QERApp_UnHookWindow( IWindowListener* pListen ){ for ( int i = 0; i < l_WindowListeners.GetSize(); i++ ) { if ( l_WindowListeners.GetAt( i ) == pListen ) { l_WindowListeners.RemoveAt( i ); pListen->DecRef(); return; } } #ifdef _DEBUG Sys_FPrintf( SYS_WRN, "WARNING: IWindowListener not found in QERApp_UnHookWindow\n" ); #endif }
void EndOfSMTP () { // 等待所有线程执行完毕 for ( int i=0; i<g_PtrAry_Threads.GetSize(); i++ ) { HANDLE hThread = (HANDLE)g_PtrAry_Threads.GetAt(i); if ( HANDLE_IS_VALID(hThread) ) { WaitForThreadEnd ( &hThread, 30*1000 ); } } g_PtrAry_Threads.RemoveAll (); }
CMapInfo* FindInMap(const TCHAR* psz) { ENSURE(psz != NULL); ENSURE(*psz != 0); int nMax = (int)aMap.GetSize(); for (int i = 0; i < nMax; i++) { CMapInfo* pInfo = (CMapInfo*)aMap.GetAt(i); size_t nLen = _tcslen(pInfo->pszPrefixFrom); if (_tcsncmp(pInfo->pszPrefixFrom, psz, nLen) == 0) return pInfo; } return NULL; }
TEST_F(EngineTestParser, findSubDirs_noParentDirectory) { CPtrArray arr; int nRes = m_parser.findSubDirs(arr); if (nRes != 0) { for (int i = 0; i < nRes; i++) { CCodeDirectories* pDirs = (CCodeDirectories*)arr.GetAt(i); delete pDirs; } arr.RemoveAll(); } ASSERT_EQ(0, nRes); }
CSfxModel::~CSfxModel() { CPtrArray<Particle>* particles; int j; for (int i = 0; i < m_particles.GetSize(); i++) { particles = m_particles[i]; if (particles) { for (j = 0; j < particles->GetSize(); j++) Delete(particles->GetAt(j)); Delete(particles); } } }
void WINAPI QERApp_UnHookGLWindow(IGLWindow* pGLW) { for( int i = 0; i < l_GLWindows.GetSize(); i++ ) { if (l_GLWindows.GetAt(i) == pGLW) { l_GLWindows.RemoveAt(i); pGLW->DecRef(); return; } } #ifdef _DEBUG Sys_Printf("ERROR: IGLWindow* not found in QERApp_UnHookGLWindow\n"); #endif }
void EditSerializer::WritePersistentArray(DataField field, const CPtrArray& a) { WriteBegin(field, 0); WriteUInt32(DataField_Length, a.GetSize()); char itemName[16]; for (int i=0; i<a.GetSize(); i++) { sprintf(itemName, "[%d]", i); const Persistent_c* const p = (const Persistent_c* const)a.GetAt(i); WritePersistent(itemName, *p); } WriteEnd(); }
void CPropMapCtrl::OnDeleteProperty() { // Fire the Delete Property Event // FireDeleteProperty(m_pPropMap, NULL); // go through the list of properties and delete each selected one int iSelected = m_listCtrl.GetSelectedCount(); if (iSelected == 0) return; CPtrArray cpaSelections; cpaSelections.SetSize(iSelected); int iItem = m_listCtrl.GetNextItem(-1, LVNI_SELECTED); int i = 0; int iLastItem; while (iItem != -1) { iLastItem = iItem; cpaSelections.SetAt(i++, (CPropListData *) m_listCtrl.GetItemData(iItem)); iItem = m_listCtrl.GetNextItem(iItem, LVNI_SELECTED); } HRESULT hr = S_OK; BSTR bstrName = NULL; for (i = cpaSelections.GetSize() - 1; i > -1; i--) { CPropListData *pld = (CPropListData *) cpaSelections.GetAt(i); if (!pld) break; // iItem is the selected item BOOL bFailed = FALSE; bstrName = pld->m_strName.AllocSysString(); hr = m_pPropMap->Remove(bstrName); if (FAILED(hr)) goto failexit; iLastItem--; } m_listCtrl.SelectItem(iLastItem + 1); failexit: // clean up SAFEFREESTRING(bstrName); }
void Map_Read( IDataStream *in, CPtrArray *map ){ entity_t *pEntity; char *buf; unsigned long len = in->GetLength(); buf = new char[len + 1]; in->Read( buf, len ); buf[len] = '\0'; StartTokenParsing( buf ); abortcode = MAP_NOERROR; while ( abortcode == MAP_NOERROR ) { if ( !GetToken( true ) ) { // { or NULL break; } pEntity = Entity_Alloc(); pEntity->pData = new CPtrArray; Entity_Parse( pEntity ); map->Add( pEntity ); } delete [] buf; if ( abortcode != MAP_NOERROR ) { int num_ents, num_brushes,i,j; entity_t *e; CPtrArray *brushes; num_ents = map->GetSize(); for ( i = 0; i < num_ents; i++ ) { e = (entity_t*)map->GetAt( i ); brushes = (CPtrArray*)e->pData; num_brushes = brushes->GetSize(); for ( j = 0; j < num_brushes; j++ ) { Brush_Free( (brush_t *)brushes->GetAt( j ), true ); } brushes->RemoveAll(); delete brushes; Entity_Free( e ); } map->RemoveAll(); } }
void Select_Reselect() { brush_s* b; CPtrArray holdArray; for ( b = selected_brushes.next ; b && b != &selected_brushes ; b = b->next ) { holdArray.Add( reinterpret_cast<void*>( b ) ); } int n = holdArray.GetSize(); while ( n-- > 0 ) { b = reinterpret_cast<brush_s*>( holdArray.GetAt( n ) ); Select_Brush( b ); } Sys_UpdateWindows( W_ALL ); }
TEST_F(EngineTestParser, findSubDirs_findAllSubDirectories) { CPtrArray arr; CCodeDirectories* pDirs = new CCodeDirectories; pDirs->m_strOriginalDir = m_parser.getCurrentPath(); arr.Add(pDirs); int nRes = m_parser.findSubDirs(arr); if (nRes != 0) { for (int i = 0; i < nRes; i++) { pDirs = (CCodeDirectories*)arr.GetAt(i); delete pDirs; } arr.RemoveAll(); } SetCurrentDirectory(g_strCurrentDir.c_str()); ASSERT_NE(0, nRes); }
void Map_FreeEntities( CPtrArray *ents ){ int i, j, num_ents, num_brushes; entity_t* e; CPtrArray* brushes; num_ents = ents->GetSize(); for ( i = 0; i < num_ents; i++ ) { e = (entity_t*)ents->GetAt( i ); brushes = (CPtrArray*)e->pData; num_brushes = brushes->GetSize(); for ( j = 0; j < num_brushes; j++ ) Brush_Free( (brush_t*)brushes->GetAt( j ) ); brushes->RemoveAll(); delete (CPtrArray*)e->pData; e->pData = NULL; Entity_Free( e ); } ents->RemoveAll(); }
TEST_F(EngineTestParser, findCodesFiles_noCodesFiles) { CPtrArray arr; CCodeDirectories* pDirs = new CCodeDirectories; pDirs->m_strOriginalDir = m_strRootPath.c_str(); arr.Add(pDirs); int nRes = m_parser.findSubDirs(arr); EXPECT_NE(0, nRes); bool bRes = m_parser.findCodesFiles(arr); nRes = arr.GetSize(); if (nRes != 0) { for (int i = 0; i < nRes; i++) { CCodeDirectories* pDirs = (CCodeDirectories*)arr.GetAt(i); delete pDirs; } arr.RemoveAll(); } SetCurrentDirectory(g_strCurrentDir.c_str()); ASSERT_FALSE(bRes); }
void CShaderArray::SortShaders() { CPtrArray aux; int i,icount; int j,jcount; CShader *pSort; const char *sSort; // dumb sort .. would it ever grow big enough so we would have to do something clever? noooo icount = CPtrArray::GetSize(); for( i = 0; i < icount ; i++ ) { pSort = static_cast<CShader *>(GetAt(i)); sSort = pSort->getName(); jcount = aux.GetSize(); for( j = 0; j < jcount ; j++ ) { if (strcmp(sSort, static_cast<CShader *>(aux.GetAt(j))->getName()) < 0) break; } aux.InsertAt(j, pSort); } CPtrArray::RemoveAll(); CPtrArray::InsertAt(0, &aux); }
bool PokerTableWnd::AnimateCollectChips(WinThread* pThread, CollectChipsAnimationInfo* pAnimationInfo){ int nSecAnimate = pAnimationInfo->m_nAnimationSec; int nFrameCt = 15; int nSkipFrames = 0; int nLoop = 0; int nCt = m_nMaxPlayerCt; int nMainChips = pAnimationInfo->m_nMainChipsAmount; int nChipsCt = 0; float fArrPosX[] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; float fArrPosY[] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; CRect rcChips [] = {CRect(0, 0, 0, 0), CRect(0, 0, 0, 0), CRect(0, 0, 0, 0), CRect(0, 0, 0, 0), CRect(0, 0, 0, 0), CRect(0, 0, 0, 0), CRect(0, 0, 0, 0), CRect(0, 0, 0, 0), CRect(0, 0, 0, 0), CRect(0, 0, 0, 0)}; // Collect chips controls. ESChildControlChips* pMainChips = GetMainChipsControl(); ESChildControlChips* ppChips[] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; // Crush // pMainChips = NULL; while( nLoop < nCt ){ PokerTableSeatInfo* pSeat = GetSeatInfo(nLoop); if( !pSeat || pSeat->GetPotAmount() <= 0 ){ nLoop ++; continue; } ppChips[nLoop] = GetChipsControl(nLoop); if( ppChips[nLoop] ){ if( ppChips[nLoop]->GetAmount() <= 0 ){ ppChips[nLoop] = NULL; } else{ rcChips[nLoop] = ppChips[nLoop]->GetClientRect(); fArrPosX[nLoop] = ppChips[nLoop]->GetLogicalPosX(); fArrPosY[nLoop] = ppChips[nLoop]->GetLogicalPosY(); nChipsCt ++; } } nLoop ++; } // }} if( !nChipsCt ){ PostMessage(WM_COLLECT_CHIPS_FINISHED, 0, 0); return true; // Stop animation. } // Collect chips sound. PokerGUI::GetInstance()->PlaySoundByType(SoundTypes::Sound_ChipsMovedToPot, 1, 0); // Animation movement(s) int nFrame = 0; CRect rcChipsBound; float fDelay = 1000.0f / ((float)(nFrameCt / ((float)nSecAnimate))); float fAccelerate = 0.97f; while( nFrame < nFrameCt ){ int nLoop1 = 0; if( (nFrame + nSkipFrames) == nFrameCt ) break; rcChipsBound.SetRect(MAXINT,MAXINT,MAXINT,MAXINT); CPtrArray* pArrRects = new CPtrArray(); while( nLoop1 < nCt ){ if( !ppChips[nLoop1] ){ nLoop1 ++; continue; } if( pThread->IsStopEventSignaled() ){ // Finished. PostMessage(WM_COLLECT_CHIPS_FINISHED, 0, 0); return true; // Stop animation. } CRect rcMainChips = pMainChips->GetClientRect(); CPoint ptMiddle(rcMainChips.left + rcMainChips.Width()/2, rcMainChips.top + rcMainChips.Height()/2); ESChildControlChips* pChips = ppChips[nLoop1]; CRect rcRectChips = pChips->GetClientRect(); CRect rcChipOrig = rcChips[nLoop1]; CPoint ptMiddleChips (rcChipOrig.left + rcChipOrig.Width()/2, rcChipOrig.top + rcChipOrig.Height()/2); int nMoveCY = ptMiddle.y - ptMiddleChips.y; int nMoveCX = ptMiddle.x - ptMiddleChips.x; int nOffsetY = rcChipOrig.top + (nMoveCY / nFrameCt)*(nFrame + 1); int nOffsetX = rcChipOrig.left + (nMoveCX / nFrameCt)*(nFrame + 1); CRect rcTableWnd; GetClientRect(rcTableWnd); float fY = (nOffsetY*1.0f) / ((float)rcTableWnd.Height()); float fX = (nOffsetX*1.0f) / ((float)rcTableWnd.Width()); pChips->SetLogicalPos (fX, fY); pChips->OwnerWindowSizeChanged (rcTableWnd.Width(), rcTableWnd.Height()); rcRectChips |= pChips->GetClientRect(); pThread->Lock(); // Lock pArrRects->Add(new CRect(rcRectChips.left, rcRectChips.top, rcRectChips.right, rcRectChips.bottom)); pThread->Unlock(); // Unlock rcChipsBound |= rcRectChips; nLoop1 ++; } if( rcChipsBound.Width() < 300 ){ for(int i=0; i<pArrRects->GetCount(); i++){ CRect* pRect = (CRect*)pArrRects->GetAt(i); delete pRect; } pArrRects->RemoveAll(); CRect* pRectBound = new CRect(rcChipsBound); pArrRects->Add(pRectBound); ::PostMessage(GetSafeHwnd(), WM_REDRAW_RECT, 1, (LPARAM)pArrRects); } else{ ::PostMessage(GetSafeHwnd(), WM_REDRAW_RECT, 1, (LPARAM)pArrRects); } // int nSleep = (int)(fDelay*fAccelerate); Sleep(30); // fAccelerate *= fAccelerate; nFrame ++; } // Wait Sleep(10); // Clear seat pot amounts. int nLoop1 = 0; while( nLoop1 < nCt ){ if( !ppChips[nLoop1] ){ nLoop1 ++; continue; } ESChildControlChips* pChips = ppChips[nLoop1]; CRect rcRectChips = pChips->GetClientRect(); CRect rcTableWnd; GetClientRect(rcTableWnd); pChips->SetAmount (0, false); pChips->SetLogicalPos (fArrPosX[nLoop1], fArrPosY[nLoop1]); pChips->OwnerWindowSizeChanged (rcTableWnd.Width(), rcTableWnd.Height()); nLoop1 ++; } if( pThread->IsStopEventSignaled() ){ PostMessage(WM_COLLECT_CHIPS_FINISHED, 0, 0); return true; // Stop animation. } pThread->Lock(); // Lock // Redraw all chips area at once. CPtrArray* pArrRects = new CPtrArray(); pArrRects->Add(new CRect(rcChipsBound.left, rcChipsBound.top, rcChipsBound.right, rcChipsBound.bottom)); CRect rcMainChips = pMainChips->GetClientRect(); pArrRects->Add(new CRect(rcMainChips.left, rcMainChips.top, rcMainChips.right, rcMainChips.bottom)); SetMainPotAmount (nMainChips, false); ::PostMessage(GetSafeHwnd(), WM_REDRAW_RECT, 1, (LPARAM)pArrRects); pThread->Unlock(); // Unlock Sleep(100); PostMessage(WM_COLLECT_CHIPS_FINISHED, 0, 0); return true; }
void DispatchOnMouseMove( guint32 nFlags, int x, int y ){ for ( int i = 0; i < l_WindowListeners.GetSize(); i++ ) static_cast<IWindowListener*>( l_WindowListeners.GetAt( i ) )->OnMouseMove( nFlags, x, y ); }
// 사용자 정보 조회 결과 LRESULT CRegNewUserDlg::OnGetUserInfoRslt(WPARAM wParam, LPARAM lParam) { CPtrArray* pArray = (CPtrArray*)lParam; for(int i = 0; i < pArray->GetSize(); i++) { SUSER_INFO *pData = static_cast<SUSER_INFO*>(pArray->GetAt(i)); m_strJuminNo = pData->m_strJUMIN_NO; m_strName = pData->m_strUSER_NAME; m_strId = pData->m_strUSER_ID; m_strPw1 = m_strPw2 = pData->m_strPASSWD; m_strGrade = pData->m_strJOB_CLASS; m_strCompany = pData->m_strCOMPANY_POS; m_strIdOld = m_strId; //소속 조회 TRACEX("RAWSQL_GETCOMPANY_INFO 요청!\n"); CString strSql; strSql = GetQueryCompany(); // name, code 구한다. if(CChatSession::Instance().RequestRawSQL(RAWSQL_GETCOMPANY_INFO, (LPCSTR)strSql, strlen((LPCSTR)strSql) ) != TRUE) { return FALSE ; } m_strJobWrite = pData->m_strJOB_WRITE_GN; if( m_strJobWrite == _T("Y") ) m_nDocYesNo = 0; else m_nDocYesNo = 1; m_strTelOfc = pData->m_strOFF_TEL_NO; m_strTelIn = pData->m_strOFF_IN_NO; m_strTelHp = pData->m_strHP_TEL_NO; m_strTeamGn = pData->m_strTEAM_GN; } // 사무실전화번호 if( m_strTelOfc.GetLength() >= 12 ) { m_strTelOfc1.Format(_T("0%d"), atoi(m_strTelOfc.Left(4))); m_strTelOfc2 = m_strTelOfc.Mid(4, 4); if( m_strTelOfc2.GetAt(0) == _T('0') ) { m_strTelOfc2.Delete(0, 1); } m_strTelOfc3 = m_strTelOfc.Right(m_strTelOfc.GetLength() - 8); } else m_strTelOfc1 = m_strTelOfc2 = m_strTelOfc3 = _T(""); // 핸드폰번호 if( m_strTelHp.GetLength() >= 12 ) { m_strTelHp1.Format(_T("0%d"), atoi(m_strTelHp.Left(4))); m_strTelHp2 = m_strTelHp.Mid(4, 4); if( m_strTelHp2.GetAt(0) == _T('0') ) { m_strTelHp2.Delete(0, 1); } m_strTelHp3 = m_strTelHp.Right(m_strTelHp.GetLength() - 8); } else m_strTelHp1 = m_strTelHp2 = m_strTelHp3 = _T(""); // Clear for(int j = 0; j < pArray->GetSize(); j++) { SUSER_INFO *pData = static_cast<SUSER_INFO*>(pArray->GetAt(j)); if(pData != NULL) { delete pData; } } delete pArray; UpdateData(FALSE); return TRUE; }