ActiveX control for C-Bus

Discussion in 'General Discussion' started by mattyh, May 1, 2008.

  1. mattyh

    mattyh

    Joined:
    Mar 18, 2008
    Messages:
    28
    Likes Received:
    0
    Location:
    SE Melbourne
    Do any developers know how to create an ActiveX wrapper in C++ or Delphi?

    My idea is that an ActiveX object could be used in webpages [ie; Javascript/VBScript/JScript via myObj = new ActiveXObject(Application.Class) - or similiar ] and even other apps to access the functions easily.

    This way savvy web designers could make really intuitive pages for automation.

    Opens up a whole new world of control. (not that ServerX isnt a good application by itself)

    Something to think about...

    Cheers,
    Matt
     
    mattyh, May 1, 2008
    #1
  2. mattyh

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    ActiveX is about the worse technology choice for webpages. Almost no one allows ActiveX control to execute form the web anymore. You would be better of creating a Javascript library to talk to a webservice or using flash/air, silverlight or java.
     
    Richo, May 1, 2008
    #2
  3. mattyh

    mattyh

    Joined:
    Mar 18, 2008
    Messages:
    28
    Likes Received:
    0
    Location:
    SE Melbourne
    Yeah I agree on the ActiveX controls. But if you make an ActiveX wrapper library with no interface which are used a fair bit (at least in windows environments), it allows web scripts to call the windows driver functions directly.

    Something that like could be useful to people.
     
    mattyh, May 2, 2008
    #3
  4. mattyh

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    Its actually a lot more complex than that.

    If you put an activeX control in a web page, the lifetime of the control is while the page exists.

    So you actually need to have 2 things: A back-end server that is persistent, which connects permanently to cbus, does stuff, knows what's going on. And then you need to have an ActiveX thingy which connects to that back end server.

    This way you get SPEEEEEEED.

    Trying to wrap oodles of stuff into an ActiveX control is possible but gives terrible performance and makes things like delivery of alerts (based on bus detected events) difficult if not impossible.

    (Here speeketh experience).

    Suggestion for anybody who wants to do this: Make you ActiveX controls talk to C-Gate. That way the back end server thingy is done, so about 60% of the job is complete. But after that.... goooooooooooooooooood luuuuuuuuuuuuck!!
     
    ashleigh, May 2, 2008
    #4
  5. mattyh

    mattyh

    Joined:
    Mar 18, 2008
    Messages:
    28
    Likes Received:
    0
    Location:
    SE Melbourne
    Haha, yes I did stumble across the reporting of events issue and activex object only lasting as long as the page loads. I haven't tried yet but I read somewhere it's possible to make an ActiveX executable which acts the same as a DLL library but remains open after it is loaded so then you can manually connect/disconnect to C-Bus in your script whenever you wish.

    But you're right, the more I think about it the more hurdles I come across...

    I did find another ActiveX control that seems to get around the event handling -> http://www.meadroid.com/scriptx/docs/gendocs.htm#eventSink

    My main reason for trying to build an ActiveX library was for another control application that uses JScript or VBScript to write your own mini-apps and was only for controlling/knowing the status of one thing at a time. The thought of genuine web control was just a bonus.

    Oh well. My balloon certainly has been popped.
    ...for the time being.

    Thanks anyway guys. I'll try figure out another way of getting JScript/VBScript operable.

    Cheers,
    Matt
     
    mattyh, May 2, 2008
    #5
  6. mattyh

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    I would seriously look at doing it all in Javascript. You would need a HTTP proxy to c-gate, possibly ServerX could do this. Although if you have programming experience it wouldn't be too hard to write a proxy that wrapped C-gate calls/responses into HTTP. The tricky bit would be the multiple responses to long running commands and adhoc events. However, I'm pretty sure there are Javascript libraries available that offer solutions to these issues.

    It would be a very interesting problem to investigate and would require a lot of javascript. So not an easy path for someone without Javascript fu. Although using one of the javascript frameworks would solve a lot of the problems.
     
    Richo, May 3, 2008
    #6
  7. mattyh

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    For the case of non web-based access to C-Bus, Clipsal is releasing an OPC Server soon. This will be payware, but there are heaps of toolkits available for all popular languages for workign with OPC allows virtually a drag'n'drop interface for accessing C-Bus.

    So say you wanted to write a custom .Net application that could read and write to Lighting Groups you would just install one of these OPC Client toolkits into you development environemnt and read write properties of controls like you do with edit controls and buttons now. Virtually zero C-Bus knowledge required.

    OPC Developer tools: http://www.opcconnect.com/
    Accessing OPC Server from the web: http://www.opcwebclient.com/

    (I can't offer specific recommedations of any of the products listed on the above sites)
     
    Richo, May 3, 2008
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.