CBus Driver Software - Issues

Discussion in 'General Discussion' started by John@DHW, Jul 4, 2005.

  1. John@DHW

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,400
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    OK, well, with the source, you can see what all the interfaces (and guts underneath) are. You can use the existing DLL which is still up as a download, and build a VC or VB project against the DLL - using the source as some guidance for digging to find what might be happening.

    Building as a COM object, as far as I know, implies that the thing *musT* be multi-threaded or capable of being used in a multi-threaded manner (the apartment model effectively means that everything is run as a single-thread with concurrency at the entry point level). This may or may not be magicified for you through the way interfaces are defined. Going the COM way seems to me to be adding an extra layer of complexity.

    We've had users in the past wrap the code so that it runs as a separate process, and it has a socket I/O interface for sending commands to it. Where this has been done, its been closed-source and not something we've seen - those who have done it have kept it to themselves. But they sure as heck did not use COM!
     
    ashleigh, Jan 2, 2010
    #41
  2. John@DHW

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    Ah, well see your right again. Did I say COM, that must have been on my mind for some reason.

    I don't need COM I just need to reference the DLL in my application and be able to call the functions.

    BTW the Borland one you built, what exactly does it end up as? The installer for it does stuff with CBM.dll so I assumed it was COM, but looking again it's not.

    Is it just putting it in c:\windows\system32 and nothing else?

    I might actually be a lot closer than I first realised, as I can build the project, so I might also be able to now attach the debugger to it and see what happens.

    Cheers

    Rohan
     
    rhamer, Jan 2, 2010
    #42
  3. John@DHW

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    Progress at last :D

    I have successfully got the sample VB app to work equally as well with a DLL that I built from the source in VS.

    The entry point names are different for some reason (no leading _), but once I figured that out away we went.

    Now by equally as well, I mean it doesn't work, or break it just does nothing, but the good news is I should be able to build a debug version of the dll and attach the debugger to it....... Of course I've never done this before, but I've seen others do it, so it can't be that hard :rolleyes:

    Cheers

    Rohan
     
    rhamer, Jan 2, 2010
    #43
  4. John@DHW

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    I have made some more progress on this, but not got to the bottom of it yet.

    I have discovered the commands are not being sent because the routine that checks the TX queue on a timer thinks the queue is empty.

    I don't know if it actually is empty or not, as I haven't finished debugging in both directions yet.

    I added file logging to the DLL because I couldn't figure out how to attach the debugger. However I'm back at work today so I now have access to greater C/C++ minds than me.

    Hopefully it won't be long now.

    Cheers

    Rohan
     
    rhamer, Jan 10, 2010
    #44
  5. John@DHW

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,400
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    When I was looking at this stuff a couple of years ago, the queues were being processed just fine. The troubles were all to do with the madness of multiple threads and several entry points being called at the same time.
     
    ashleigh, Jan 11, 2010
    #45
  6. John@DHW

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    I really don't know enough yet to be certain.

    However more good news is, thanks to the help of a couple of my colleagues I have got the debugger attached (in VS) so fingers crossed I should be able to figure it out.

    Cheers

    Rohan
     
    rhamer, Jan 11, 2010
    #46
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.