Datalogic .NET SDK

CancelRequest (Method)

 

Syntax

 

    public bool CancelRequest(int reqID);

 

 

Class                           : DecodeHandle

Namespace                : Datalogic.API

Assembly                   : Datalogic.API.DLL

 

 

Description

Cancels a request previously posted to a decoding device.

 

Parameters Table

 

Type

Parameter

Description

[in]

int

reqID

Request identifier of the request to cancel. The DcdPostRequest functions return this identifier.

 

 

 

 

[return]

bool

 

True is returned on success, otherwise false is returned. Specifying a request ID that has not been posted will return false.

[on error]

FALSE

 

-

 

 

 

Example

 

 

 

// Cancel Request button

private void button2_Click(object sender, EventArgs e)

{

      if (listBox1.Items.Count > 0 && listBox1.SelectedIndex >=0)

      {

            int index = listBox1.SelectedIndex;

            int reqID = Int32.Parse(listBox1.Items[index].ToString());

            bool success = hDcd.CancelRequest(reqID);

            if (success)

            {

                  listBox1.Items.RemoveAt(index);

                  if (listBox1.Items.Count > 0)

                  {

                        _ReqActive = Int32.Parse(listBox1.Items[0].ToString());

                  }

                  else

                        _ReqActive = -1;

            }

       }

       UpdateGUI();

}

 

 

 

See Also

DecodeRequest (Enum), ReadString(1), PostRequestMsgEx, Example #008.

 

Copyright © Datalogic ADC. All Right Reserved