1. Nguyen Xuan Huy
  2. PowerBuilder
  3. Friday, 14 August 2020 05:56 AM UTC

How to programming in appeon with ole object of MScomm32 ?

Nguyen Xuan Huy Accepted Answer Pending Moderation
  1. Monday, 17 August 2020 10:33 AM UTC
  2. PowerBuilder
  3. # 1

Hi Chris and René

 

Thank you for your guide idea.

Maybe I placed a wrong question before.

My concern is that I cannot distinguish between barcode scanner and keyboard input on itemchanged event of datawindow.

If you have any guide idea, please help

Thanks

Huy

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 14 August 2020 14:09 PM UTC
  2. PowerBuilder
  3. # 2

Hi Nguyan;

   This DLL is (was) normally used for serial port communications. If you Google "PowerBuilder mscomm" you should find some good examples.

   Note that you can also do serial port communications via PB's built-in File open, read & write commands.

Regards ... Chris

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Friday, 14 August 2020 07:18 AM UTC
  2. PowerBuilder
  3. # 3

Hi Nguyen Xuan Huy,

you should describe what you want to do with MSComm OCX to get a precise answer.

To start with OLE:

OleObject lole_comm

TRY

  lole_comm = CREATE OleObject
  li_rc = lole_comm.ConnectToNewObject ("MSCOMMLib.MSComm")
  // check return code

  // use the OCX, e.g.
  lole_comm.CommPort = 2

CATCH (OLERuntimeError errole)

  // catch OLE errors

FINALLY

  // Destroy
  lole_comm.Disconnectobject ()
  DESTROY lole_comm

END TRY

 

HTH,

René

 

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.