本文整理汇总了C++中CDWordArray::GetAt方法的典型用法代码示例。如果您正苦于以下问题:C++ CDWordArray::GetAt方法的具体用法?C++ CDWordArray::GetAt怎么用?C++ CDWordArray::GetAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDWordArray
的用法示例。
在下文中一共展示了CDWordArray::GetAt方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
BOOL CBCGPRegistry::Read(LPCTSTR pszKey, LPPOINT& lpPoint)
{
ASSERT(m_hKey);
BOOL bSucess = FALSE;
BYTE* pData = NULL;
UINT uDataSize;
Read (pszKey, &pData, &uDataSize);
try
{
if (pData != NULL && m_Info.lMessage == ERROR_SUCCESS && m_Info.dwType == REG_BINARY)
{
CMemFile file (pData, uDataSize);
CArchive ar (&file, CArchive::load);
ar.m_bForceFlat = FALSE;
ASSERT(ar.IsLoading());
CDWordArray dwcArray;
ASSERT(dwcArray.IsSerializable());
dwcArray.Serialize(ar);
ar.Close();
if (dwcArray.GetSize() == 2)
{
lpPoint->x = dwcArray.GetAt(0);
lpPoint->y = dwcArray.GetAt(1);
bSucess = TRUE;
}
}
}
catch (CMemoryException* pEx)
{
pEx->Delete ();
TRACE(_T("Memory exception in CBCGPRegistry::Read ()!\n"));
}
catch (CArchiveException* pEx)
{
pEx->Delete ();
TRACE(_T("CArchiveException exception in CBCGPRegistry::Read ()!\n"));
}
m_Info.dwType = REG_POINT;
m_Info.dwSize = sizeof(POINT);
if (pData != NULL)
{
delete [] pData;
pData = NULL;
}
return bSucess;
}
示例2: addHpMp
//加HP,MP
void addHpMp(bool isheordz)
{
//wgdebug("====================加HP MP=======================%d\n",0);
int hp, mp;
int addHpValue,addMpValue;
DWORD jnID;
ReadProcessMemory(PID, (LPCVOID)(rwBaseAddr + 0x254), &hp, 4, 0);
ReadProcessMemory(PID, (LPCVOID)(rwBaseAddr + 0x258), &mp, 4, 0);
if (dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_JH))
{
addHpValue = dlxiaoDllDlg->GetDlgItemInt(IDC_EDIT_HONG);
if (hp <= addHpValue)
{
if(isheordz){
if(dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_ISJNADDHP) && mp > 10 ){
if( addhpjnidx > -1 ){
ReadProcessMemory(PID, (LPCVOID)(jnPointerArray.GetAt(addhpjnidx) + 0x8), &jnID, 4, 0);
if(jnID){
CallUserSkill(jnID,rwId);
Sleep(300);
}else{
if(dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_ISDZ)){
dazuo();
}
}
}else{
if(dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_ISDZ)){
dazuo();
}
}
}else if(dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_ISDZ)){
dazuo();
}
}else{
AddRed();
}
}
}
if (dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_JL))
{
addMpValue = dlxiaoDllDlg->GetDlgItemInt(IDC_EDIT_LANG);
if (mp <= addMpValue)
{
if(dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_ISDZ) && isheordz){
dazuo();
}else{
AddBlue();
}
}
}
//wgdebug("====================END 加HP MP=======================%d\n",0);
}
示例3: addfz
void addfz()
{
int fzjnCount =0;
int jnID;
if(dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_ISFZJN)){
ReadProcessMemory(PID, (LPCVOID)(rwBaseAddr + 0x118), &fzjnCount, 4, 0);
if(fzjnCount == 0){
if( fzjnidx > -1 ){
ReadProcessMemory(PID, (LPCVOID)(jnPointerArray.GetAt(fzjnidx) + 0x8), &jnID, 4, 0);
if(jnID){
CallUserSkill(jnID,rwId);
}
}
}
}
}
示例4: Read
BOOL CRegistry::Read(LPCTSTR pszKey, LPPOINT& lpPoint)
{
ASSERT(m_hKey);
const int iMaxChars = 20;
CDWordArray dwcArray;
DWORD dwType;
DWORD dwData = iMaxChars;
BYTE* byData = (BYTE*)::calloc(iMaxChars, sizeof(TCHAR));
ASSERT(byData);
LONG lReturn = RegQueryValueEx(m_hKey, pszKey, NULL, &dwType,
byData, &dwData);
if(lReturn == ERROR_SUCCESS && dwType == REG_BINARY)
{
ASSERT(dwData < iMaxChars);
CMemFile file(byData, dwData);
CArchive ar(&file, CArchive::load);
ar.m_bForceFlat = FALSE;
ASSERT(ar.IsLoading());
ASSERT(dwcArray.IsSerializable());
dwcArray.RemoveAll();
dwcArray.SetSize(5);
dwcArray.Serialize(ar);
ar.Close();
file.Close();
lpPoint->x = dwcArray.GetAt(0);
lpPoint->y = dwcArray.GetAt(1);
}
m_Info.lMessage = lReturn;
m_Info.dwType = REG_POINT;
m_Info.dwSize = sizeof(POINT);
if(byData)
{
free(byData);
byData = NULL;
}
if(lReturn == ERROR_SUCCESS)
return TRUE;
return FALSE;
}
示例5: StartNewGame
void CCLLKDlg::StartNewGame(void)
{
CTime t=CTime::GetCurrentTime();
tGameTime=t;
strTiShi1="系统时间:"+t.Format("%H:%M:%S");
m_StatusBar.SetText(strTiShi1,2,0);
strTiShi2.Format(" 该局时间:00:00:00");
m_StatusBar.SetText(strTiShi2,1,0);
strTiShi3.Format("当前游戏:%d行%d列%d种方块",m_nRow-2,m_nCol-2,m_Kind);
m_StatusBar.SetText(strTiShi3,0,0);
delete[] m_map;
m_map=new int[m_nCol*m_nRow];
for (int iNum=0;iNum<(m_nCol*m_nRow);iNum++)
{
m_map[iNum]=BLANK_STATE;
}
srand(time(NULL));
CDWordArray tmpMap;
for (int i=0;i<(m_nRow-2)*(m_nCol-2)/2;i++)
{
int x=rand()%m_Kind;
tmpMap.Add(x);
tmpMap.Add(x);
}
for (int i=1;i<(m_nCol-1);i++)
{
for (int j=1;j<(m_nRow-1);j++)
{
INT_PTR nIndex=(int(rand()*0.1+rand()*0.01+rand()))%tmpMap.GetSize();
m_map[i+j*m_nCol]=tmpMap.GetAt(nIndex);
tmpMap.RemoveAt(nIndex);
}
}
Invalidate(false);
}
示例6: DoKeyedDeselect
// When starting a mouse-key select, the anchor point, and all contiguous
// selections that are not in the path of the current item can remain
// selected. All other selections are tossed, like Exploder does.
void CMultiSelTreeCtrl::DoKeyedDeselect( BOOL scrollingDown )
{
CDWordArray keepSet;
HTREEITEM currentItem= m_AnchorItem;
// Record the contiguous selection's we're keeping
keepSet.Add( (DWORD) m_AnchorItem );
while(1)
{
if( scrollingDown )
currentItem= GetPrevSiblingItem( currentItem);
else
currentItem= GetNextSiblingItem( currentItem);
if( currentItem == NULL || !IsSelected( currentItem ) )
break;
keepSet.Add( (DWORD) currentItem );
}
// Unselect everything
//
int i;
for( i= m_SelectionSet.GetSize()-1; i >= 0; i-- )
{
currentItem= (HTREEITEM) m_SelectionSet.GetAt(i);
// Undo any display atts
SetItemState(currentItem, 0, TVIS_CUT | TVIS_BOLD | TVIS_SELECTED);
}
// Then select everything in the keepset
//
m_SelectionSet.RemoveAll();
for( i= keepSet.GetSize()-1; i>=0; i-- )
SetSelectState( (HTREEITEM) keepSet.GetAt(i), TRUE );
m_PendingKeyedDeselect= FALSE;
ShowNbrSelected();
}
示例7: Read
//***************************************************************************************
BOOL CBCGPXMLSettings::Read(LPCTSTR pszKey, LPPOINT& lpPoint)
{
BOOL bSucess = FALSE;
BYTE* pData = NULL;
UINT uDataSize;
if (!Read (pszKey, &pData, &uDataSize))
{
ASSERT (pData == NULL);
return FALSE;
}
ASSERT (pData != NULL);
try
{
CMemFile file (pData, uDataSize);
CArchive ar (&file, CArchive::load);
CDWordArray dwcArray;
dwcArray.SetSize(5);
dwcArray.Serialize (ar);
lpPoint->x = dwcArray.GetAt(0);
lpPoint->y = dwcArray.GetAt(1);
bSucess = TRUE;
}
catch (CMemoryException* pEx)
{
pEx->Delete ();
TRACE(_T("Memory exception in CBCGPXMLSettings::Read ()!\n"));
}
catch (CArchiveException* pEx)
{
pEx->Delete ();
TRACE(_T("CArchiveException exception in CBCGPXMLSettings::Read ()!\n"));
}
return TRUE;
}
示例8: GetUndoActions
void CSynBCGPEditView::GetUndoActions( CStringList& lstActions ) const
{
CDWordArray dwaUAT;
m_pEdit->GetUndoActions(dwaUAT);
lstActions.RemoveAll();
int nIndex = (int)dwaUAT.GetSize();
if ( nIndex != 0)
{
CString strAction;
while (nIndex--)
{
strAction.Empty();
switch (dwaUAT.GetAt(nIndex) & UAT_REASON)
{
case g_dwUATUndefined:
strAction.LoadString(IDS_STRING_UAT_UNDEF);
break;
case g_dwUATTyping:
strAction.LoadString(IDS_STRING_UAT_TYPE);
break;
case g_dwUATCut:
strAction.LoadString(IDS_STRING_UAT_CUT);
break;
case g_dwUATPaste:
strAction.LoadString(IDS_STRING_UAT_PASTE);
break;
case g_dwUATDelete:
strAction.LoadString(IDS_STRING_UAT_DEL);
break;
case g_dwUATBackspace:
strAction.LoadString(IDS_STRING_UAT_BACK);
break;
case g_dwUATDragDrop:
strAction.LoadString(IDS_STRING_UAT_DRAG);
break;
case g_dwUATEnter:
strAction.LoadString(IDS_STRING_UAT_ENTER);
break;
case g_dwUATIndent:
strAction.LoadString(IDS_STRING_UAT_INDENT);
break;
case g_dwUATUnindent:
strAction.LoadString(IDS_STRING_UAT_UNINDENT);
break;
case g_dwUATTab:
strAction.LoadString(IDS_STRING_UAT_TAB);
break;
case g_dwUATReplace:
strAction.LoadString(IDS_STRING_UAT_REP);
break;
case g_dwUATComment:
strAction.LoadString(IDS_STRING_UAT_COMM);
break;
case g_dwUATUncomment:
strAction.LoadString(IDS_STRING_UAT_UNCOMM);
break;
case g_dwUATFormatter:
strAction.LoadString(IDS_STRING_UAT_TIDY);
break;
default:
strAction.LoadString(IDS_STRING_UAT_UNDEF);
}
if (strAction.IsEmpty())
{
ASSERT(FALSE);
strAction = _T("<?>");
}
lstActions.AddHead(strAction);
}
}
}
示例9: EmbedeedFont
bool
EmbedeedFontMan::AddFont(const CString sFontFolder, const CString sFontName){
CString sDir = sFontFolder;
if( sDir.GetAt(sDir.GetLength() - 1) != '\\' )
sDir += _T("\\");
EmbedeedFont* pFont = new EmbedeedFont();
// Load characters code map. {{
BYTE* lpContent = NULL;
int nSize = 0;
if( Path::ReadFileContent(sDir + _T("codes.txt"), lpContent, nSize) && nSize > 0 ){
CString sContent;
memcpy(sContent.GetBufferSetLength(nSize), lpContent, nSize);
CStringArray arrStrings;
StringHelper::Split(&sContent, _T(";"), arrStrings);
CString sCharCode;
for(int i=0; i<arrStrings.GetCount(); i++){
sCharCode = arrStrings.GetAt(i);
int nCharCode = 0;
// Hex value
if( sCharCode.GetAt(0) == '#' )
nCharCode = StringHelper::HexStringIntoInt(&((TCHAR*)sCharCode.GetBuffer())[1], sCharCode.GetLength() - 1);
else
nCharCode = _ttoi(sCharCode.GetBuffer());
pFont->m_arrCharacters.Add((void*)nCharCode, (void*)i);
}
}
else{
#ifdef _DEBUG
CString sMsg;
sMsg.Format(_T("Couldn't find %s"), sDir + _T("codes.txt"));
AfxMessageBox(sMsg);
#endif
if( lpContent )
delete [] lpContent;
delete pFont;
return false;
}
// }}
if( lpContent ){
delete [] lpContent;
lpContent = NULL;
}
CStringArray arrFileNames;
if( Path::GetFilesByExtention(sDir, _T("*.bmp"), arrFileNames, true) == 0 ){
delete pFont;
return false;
}
for(int i=0; i<arrFileNames.GetCount(); i++){
CString sName = arrFileNames.GetAt(i);
CString sName2 = sName;
CString sFile = sDir + sName;
if( sName.Left(sFontName.GetLength()) != sFontName )
continue; // Skip wrong file name.
sName.Delete (0, sFontName.GetLength());
sName.MakeLower ();
int nIndex = 0;
EmbedeedFontItemInfo* pInfo = new EmbedeedFontItemInfo();
pInfo->ZeroInit();
// Bold
if( sName.GetAt(nIndex) == 'b' ){
pInfo->m_nCharFlags |= EmbedeedFontItemInfo::EMBEDEED_FONT_FLAG_BOLD;
nIndex ++;
}
// Underline
if( sName.GetAt(nIndex) == 'u' ){
pInfo->m_nCharFlags |= EmbedeedFontItemInfo::EMBEDEED_FONT_FLAG_UNDERLINE;
nIndex ++;
}
// Italic
if( sName.GetAt(nIndex) == 'i' ){
pInfo->m_nCharFlags |= EmbedeedFontItemInfo::EMBEDEED_FONT_FLAG_ITALIC;
nIndex ++;
}
// Load characters map image and detect characters left offset and width (in pixels). {{
CImage* pImage = ImageHelper::LoadImage(sFile, -1, -1, false);
if( pImage ){
BITMAP bmImage;
GetObject(*pImage, sizeof(BITMAP), &bmImage);
int nWidthLimit = bmImage.bmWidth;
int nSymbolCt = 0;
BYTE* pBits = (BYTE*)bmImage.bmBits;
int nXOffset = 0;
int nBPP = bmImage.bmBitsPixel/8;
int nSymbolMostLeftOffset = -1;
int nSymbolMostRightOffset = -1;
CDWordArray arrSymbolLeftOffsetAndWidth;
CString sSymbolStartPointAndWidth;
//.........这里部分代码省略.........
示例10: GjThreadProc
UINT GjThreadProc(LPVOID lpParamter)
{
DWORD isSelectGw = 0;
DWORD gwPoint,one;
int gwId =0;
int hp = 0;
int jnID;
float rwgwjl;//人物与怪物的距离
BYTE isUsejn;//技能是否能使用
float gwx,gwy;
while (isGjFlag)
{
ReadProcessMemory(PID, (LPCVOID)(rwBaseAddr + 0x254), &hp, 4, 0);
if(hp == 0){
dead();
}else{
addHpMp(false);
ReadProcessMemory(PID, (LPCVOID)(rwBaseAddr + 0x7b8), &isSelectGw, 4, 0);
if (isSelectGw == 0)
{
if(dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_ISSELL)){
bagfull();
}
Pick();
addHpMp(true);
addfz();
dingdian();
gwPoint = getGwPoint();
if(gwPoint != 0){
ReadProcessMemory(PID,(LPCVOID)(gwPoint+8),&gwId,4,0);
if (gwId != 0 )
{
CallSelectGw(gwId);
}
}
}
else
{
CallNormal();
readRwXY();
ReadProcessMemory(PID, (LPCVOID)(gwPoint + 0x4), &one, 4, 0);
ReadProcessMemory(PID, (LPCVOID)(one + 0x3C), &gwx, sizeof(FLOAT), 0);
ReadProcessMemory(PID, (LPCVOID)(one + 0x44), &gwy, sizeof(FLOAT), 0);
rwgwjl = sqrtf(powf((rwX - gwx), 2) + powf((rwY - gwy), 2));
if(dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_ISUSERJN) && (rwgwjl <= 3) && usejnidx > -1){
ReadProcessMemory(PID, (LPCVOID)(jnPointerArray.GetAt(usejnidx) + 0x8), &jnID, 4, 0);
if(jnID){
ReadProcessMemory(PID, (LPCVOID)(jnPointerArray.GetAt(usejnidx) + 0xC), &isUsejn, 1, 0);
if(isUsejn == 0){
CallUserSkill(jnID,gwId);
}
}
}
Sleep(500);
}
}
}
return (0);
}