help-snacc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting c code into cpp code


From: Angus Comber
Subject: Converting c code into cpp code
Date: Fri, 29 Dec 2006 12:28:24 -0000

Hello

I have some SNACC c code which I want to convert into cpp code.

Here is the C code:

void testMonitorStart(char *deviceNum)
{
  MonitorStartArgument *args;

  /* Initialize the MonitorStartArgument struct */
  args = Asn1Alloc(sizeof(MonitorStartArgument));
  /* Monitored device */
  args->monitorObject = Asn1Alloc(sizeof(MonitorObject));
  args->monitorObject->choiceId = CSTAOBJECT_DEVICE;
  args->monitorObject->a.device = Asn1Alloc(sizeof(DeviceID));
  args->monitorObject->a.device->choiceId = DEVICEID_DIALINGNUMBER;
  args->monitorObject->a.device->a.dialingNumber =
Asn1Alloc(sizeof(NumberDigits));
  setoctet(args->monitorObject->a.device->a.dialingNumber, deviceNum);

  /* Process APDU (fill, encode and send the APDU) */
  processAPDU((void *) args, MONITORSTARTSID);
}


I have converted to:

void CMainDlg::testMonitorStart(char* deviceNum)
{
 MonitorStartArgument* args;
 /* Initialize the MonitorStartArgument struct */
 /* Monitored device */
 args->monitorObject->choiceId = CSTAObject.deviceCid;
 args->monitorObject->device->choiceId = DeviceID.dialingNumberCid;
 args->monitorObject->device->dialingNumber->assign(deviceNum,
lstrlen(deviceNum)); // myia5string;
 /* Process APDU (fill, encode and send the APDU) */
 processAPDU((void *) args, CSTAServices.monitorStartSID); //
MONITORSTARTSID);
}

Is this correct?

Angus






reply via email to

[Prev in Thread] Current Thread [Next in Thread]