sososososos, about bin1st, why error?
namespace tzg {
template<typename T>
struct CheckVal : public binary_function<vector<T> ,//vtVal,
PMEMORYVALUE ,// pMem
bool>
{
HANDLE hdl;
CheckVal(HANDLE hdl_)
{
hdl = hdl_;
}//
void setHandle(HANDLE hdl_)
{
hdl = hdl_;
}
bool operator() (vector<T> & vtVal,
PMEMORYVALUE pMem)
{
T *pVal = NULL;
long i = 0;
bool bRet = false;
pVal = new T[vtVal.size() + 1];
if (TRUE == Read_Mem_In_Proc(hdl, pMem->pAddr, pVal, vtVal.size(), NULL))
{
for (i = 0; i < vtVal.size(); ++i)
{
if (vtVal[i] != pVal[i])
{
break;
} //for
if (i == vtVal.size() - 1)
{
bRet = true;
} //if
} //for
} //if
delete []pVal;
return bRet;
}
};
};
template<typename T>
struct ScanImp {
HANDLE hdl;
void setHandle(HANDLE hdl_)
{
hdl = hdl_;
}
static void SetVal(string val, vector<T> &vt)
{
tzg::SetVal(val, vt);
}
static long ScanMemImpl(vector<T> &vtVal, PVOID pAddr, PBYTE pBuf, LONG lSize, vtMemVal &vtVals, hashMemVal &hashVals)
{
return tzg::ScanMemImpl(vtVal, pAddr, pBuf, lSize, vtVals, hashVals);
}
static long ScanAgain(vector<T> &vtVal, HANDLE hdl, vtMemVal &mem_val)
{
tzg::CheckVal<T> v(hdl);
remove_if(mem_val.begin(), mem_val.end(),
not1(bind1st(v, vtVal))); // Here
return static_cast<long>(mem_val.size());
}
};
//---------------------------------------------------
// Error information
d:\program files\microsoft visual studio\vc98\include\functional(162) : error C2662: '()' : cannot convert 'this' pointer from 'const struct tzg::CheckVal<unsigned short>' to 'struct tzg::CheckVal<unsigned short> &'
Conversion loses qualifiers
d:\program files\microsoft visual studio\vc98\include\functional(162) : while compiling class-template member function 'bool __thiscall std::binder1st<struct tzg::CheckVal<unsigned short> >::operator ()(struct tagMemoryValue *const & ) const
'
d:\program files\microsoft visual studio\vc98\include\functional(162) : error C2064: term does not evaluate to a function
d:\program files\microsoft visual studio\vc98\include\functional(162) : while compiling class-template member function 'bool __thiscall std::binder1st<struct tzg::CheckVal<unsigned short> >::operator ()(struct tagMemoryValue *const & ) const
'
Generating Code...
Compiling...
ScanBase.cpp
Generating Code...
Compiling...
Test_Scan.cpp
warning C4786: 'std::pair<std::_Tree<unsigned long,std::pair<unsigned long const ,tagMemoryValue *>,std::map<unsigned long,tagMemoryValue *,std::less<unsigned long>,std::allocator<tagMemoryValue *> >::_Kfn,std::less<unsigned long>,std::allocator<tag
MemoryValue *> >::iterator,bool>' : identifier was truncated to '255' characters in the debug information
Generating Code...
Error executing cl.exe.
Test_Scan.exe - 2 error(s), 1 warning(s)