How do I call an OCX

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mhoneywill
Posts: 66
Joined: Fri Feb 05, 2010 7:31 pm

How do I call an OCX

Post by mhoneywill » Sun Jan 30, 2011 10:52 pm

Hi,

I'm very new to LiveCode so please excuse the silly question, I would like to call functions in an ocx. Specifically modbus_activex from www :mrgreen: modbustools :mrgreen: com this would give me modbus functionality in windows.

Could somebody explain if this is possible. I've got a feeling that you could use the CreateObject command but I can't find any information on how to use this.

In the long run I would like to implement the Modbus code in Livecode to allow serial and Ethernet access to be crossplatform. But if I can call the ActiveX then that will fast track me to getting data from external devices into my Stack.

Cheers

Martin

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: How do I call an OCX

Post by BvG » Sun Jan 30, 2011 11:17 pm

There is no activeX in livecode. If you have access to the source code, you can create an external from that, which is the activeX equivalent of LC.


www.modbustools.com
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

mhoneywill
Posts: 66
Joined: Fri Feb 05, 2010 7:31 pm

Re: How do I call an OCX

Post by mhoneywill » Mon Jan 31, 2011 6:20 pm

Thanks BvG

Do you know if there is any way in wrapping the Activex control to create an external?

What made me think this could be done was this posting ?????? (I'm not allowed to post URL links so I can't share the message I was talking about)

Failing this I'll have to write my own Modbus RTU/TCP serial and Ethernet driver, does anyone know of any serial port example stacks or drivers I can use as a basis

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: How do I call an OCX

Post by mwieder » Mon Jan 31, 2011 6:36 pm

I doubt that getting this working through the ActiveX component will really fast-track your application, but rather sidetrack it, since it will be Windows-only. The protocol looks easy enough to implement using serial/socket commands (see Sarah Reichelt's sample stacks at http://www.troz.net/rev/stacks/SerialTest.rev). But if you really want to try going through the ActiveX component your best bet would be to write some VBScript that does this and then call it from LiveCode with a "do as VBScript" command. Ken Ray has a post with some help on how to do this at http://www.sonsothunder.com/devres/live ... ext002.htm.

Why can't you post urls?

Post Reply