Page 1 of 9 123 ... LastLast
Results 1 to 10 of 82

Thread: How to create Events in Girder without using an IR ?

  1. #1
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    29

    Default How to create Events in Girder without using an IR ?

    I need to make Girder react to a command sent by another application (VB6) in the same way it would react for example to an IR-Event.

    Has anybody an idea, how this could be accomplished ?

    As Girder does not support receiving messages from other apps, I'm a bit lost here...

  2. #2
    Join Date
    Sep 2002
    Location
    Davis, CA, USA
    Posts
    382

    Default

    Read the FAQ at http://www.girder.nl/help/faq.php#107

    How can I trigger a Girder event from outside of Girder ?

  3. #3
    Join Date
    Feb 2001
    Location
    Plano, TX, USA
    Posts
    3,055

    Default

    There is also some good information here.
    Mark F

  4. #4
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    29

    Default

    While the Info provided by Mark looks optimal, I wonder if it's making sense to use the other option (calling Girder with command-line options) - as this one would be easier to implement.

    I always thought of the command-line thing as a way to get something like different on-load actions by using different command-lines. Wouldn't it have a heavy impact on the system, when using this way to send information on a regular basis - i.e. every few seconds or so ?

  5. #5
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    Can VB link to .dll files and use exported functions ? I think it can. I'm thinking about supplying a .dll files that allowes you to easily send events to girder without writing a plugin. Simply link to that file and voila.
    Ron
    No support through PM

  6. #6
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    29

    Default

    Can VB link to .dll files and use exported functions ?
    Yes - that's no problem. Such a DLL would be great.

    Of course one could use the TCP/IP-variant referred to above - but I think it's a lot of work for a quite simple task...

  7. #7
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    does VB have suport for PCHAR arrays ?

    eg:

    gir_send_event( char * eventstring, int device, char *pld[], int pcnt )
    Ron
    No support through PM

  8. #8
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    Girder 3.2.6 now has support for this new mechanism. Download this package:

    http://www.girder.nl/developer.php?Link=442

    It includes the files needed for C, its probably pretty straightforward to translate them to VB.
    Ron
    No support through PM

  9. #9
    Join Date
    Sep 2002
    Location
    Davis, CA, USA
    Posts
    382

    Default

    AFAIK, VB can't staically link to a LIB file, but we can do a private function declare to a function in a DLL. So VB would need gireventlib.dll instead of gireventlib.lib.

    An example that I use is a function from user32.dll ( the _ are line continuation characters in VB )

    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
    (ByVal hwnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    ByVal LParam As Any) As Long

    So I believe that we should be able to declare

    int __stdcall gir_send_event_easy ( char * event, int device, char *pld1, char* pld2, char *pld3);

    As

    Private Declare Function GirSendEventEasy Lib "gireventlib" _
    Alias "gir_send_event_easy" ( ByVal event as String, _
    ByVal device as Long, _
    ByVal as pld1 as String, _
    ByVal as pld2 as String, _
    ByVal as pld3 as String) as Long

    In order to use it from VB

    As far as gir_send_event is concerned, I'm not sure how to declare the char *pld[] and void *binpld arguments...

  10. #10
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,553

    Default

    AFAIK, VB can't staically link to a LIB file, but we can do a private function declare to a function in a DLL. So VB would need gireventlib.dll instead of gireventlib.lib.
    I had a feeling that would not be possible, so gireventlib.dll is included in the Girder 3.2.6 distro. It exports the needed functions in the normal way.

    About the char*[] probably not being possible with VB, that's why I made gir_send_event_easy.
    Ron
    No support through PM

Page 1 of 9 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •