InetReceiveRsp2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveRsp2(short iComputer, short InetCommand, long nCommandID, short nError, short nStatus,
struct ILEADRasterInetPacket * Params, long nExtraDataSize, const _variant_t & ExtraData)
{
   CString szOut;
   CString szTmp;
   ILEADRasterInetPacket *Packet = Params;

   szOut.Format(TEXT("Command %d id=%d, nError=%d nStatus=%d, nParams=%d received"), InetCommand, nCommandID, nError, nStatus, Packet->GetParamCount());

   if(nExtraDataSize > 0)
   {
      szTmp.Format(TEXT(", nExtraDataSize=%d"), nExtraDataSize);
      szOut = szOut + szTmp;
   }
   OutputDebugString(szOut);
   OutputDebugString(TEXT("\n"));

   if(nError != 0)
      return;

   switch(InetCommand)
   {
      case INETCMD_LOAD:
         if((nStatus == 0) || (nStatus == 1))
         {
            if((Packet->GetParamCount() == 1) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32))
            {
               OutputDebugString(TEXT("Load SUCCEEDED!"));
            }
            else
            {
               szOut.Format(TEXT("Load failed with error code %d"), nStatus);
               OutputDebugString(szOut);
            }
         }
      break;
   }
}