ISCLChallengeResponseSuccess Example for C++ 6.0 and later

void CDicomNetSink::OnNetExternalAuthenticateISCL(long hNet, VARIANT FAR* pnChallenge, VARIANT FAR* pnResponse, VARIANT FAR* pnParameter)
{
   if(pnChallenge->cyVal.int64 + pnParameter->cyVal.int64 == pnResponse->cyVal.int64)
      m_pDlg->m_pLEADDicomNet->ISCLChallengeResponseSuccess = VARIANT_TRUE;
   else
      m_pDlg->m_pLEADDicomNet->ISCLChallengeResponseSuccess = VARIANT_FALSE;
}

static __int64 GetRandom()
{
   __int64 RandVal;
  RandVal = rand();
   RandVal = RandVal * 0x10000 + rand();
   RandVal = RandVal * 0x10000 + rand();
   RandVal = RandVal * 0x10000 + rand();
   return RandVal;
}

void CDicomNetSink::OnNetGetChallengeISCL(long hNet, VARIANT FAR* pnChallenge, VARIANT FAR* pnParameter) 
{
   COleCurrency cyChallenge;
   cyChallenge.m_cur.int64 = GetRandom() + pnParameter->cyVal.int64;
   *pnChallenge = COleVariant(cyChallenge);
   m_pDlg->m_pLEADDicomNet->ISCLChallengeResponseSuccess = VARIANT_TRUE;
}

void CDicomNetSink::OnNetInternalAuthenticateISCL(long hNet, VARIANT FAR* pnChallenge, VARIANT FAR* pnResponse, VARIANT FAR* pnParameter) 
{
   COleCurrency cyResponse;
   cyResponse.m_cur.int64 = pnChallenge->cyVal.int64 + pnParameter->cyVal.int64;
   *pnResponse = COleVariant(cyResponse);
   m_pDlg->m_pLEADDicomNet->ISCLChallengeResponseSuccess = VARIANT_TRUE;
}