Developing COM Components using VC-ATL(3-5)(3)
cTemp=strReverse.GetAt(iTemp);
iNum=atoi(&cTemp);
if(iTemp % 2 !=0)
{
iNum=iNum*2;
if(iNum>9)
iNum-=9;
}
cTemp=iNum+'0';
strFinal+=cTemp;
}
for(iTemp=0;iTemp<strFinal.GetLength();iTemp++)
{
cTemp=strFinal.GetAt(iTemp);
iSum+=atoi(&cTemp);
}
if(iSum % 10 == 0)
return S_OK;
else
return S_FALSE;
}
STDMETHODIMP CValidateCard::LengthCheck(BSTR bstrCCNo, BSTR bstrCCType)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
// TODO: Add your implementation code here
CString strType(bstrCCType),strLength(bstrCCNo);
int ilen=strLength.GetLength();
if(strType=="V")
{
if(ilen==16)return S_OK;
}