Starting Dispatcher from the program is logging

Home › Forums › CodeSite › Starting Dispatcher from the program is logging

Viewing 4 reply threads
  • Author
    Posts
    • #3798
      Andrea Magni
      Participant

        Hi Ray, I’m a happy CodeSite (Express) user since a decade. Thank for this powerful tool.

        Is it possible to start the dispatcher and the live viewer from within the process is sending log messages? I’d like to deploy CodeSite Dispatcher and LiveViewer and just activate them at a certain point of the running process (on user explicit request, for example).

        I’ve made a couple of attempts but it seems the Dispatcher really needs to be execute before launching the process generating the log messages.

        Any help or suggestion would be greatly appreciated.

        Thank you.

        Andrea

      • #3799
        Ray Konopka
        Keymaster

          Hi Andrea,
          When a program first tries to send a CodeSite message, the CodeSite logging class (TCodeSiteLogger) checks to see if the Dispatcher is running. If it is not, then the Dispatcher is started. The logger class looks in the Registry for the location of the CodeSite Dispatcher in case the CodeSite Tools are installed on the computer. If the Registry entry is present, the Dispatcher at that location is launched. If the Registry entry is not present, then the logger will look in the current directory of the application and launch the CSDispatcher.exe file if it is present.

          Having the Dispatcher get started by an application is quite common and I do that all the time. I’m curious to learn more about your attempts and what type of application you are building and how you are using CodeSite Express. Feel free to send an email to support@raize.com and I’ll be happy to assist in tracking down the issues.

          Ray

        • #4565
          Hans Brand
          Participant

            Hi Ray,

            There is a function I can use to check if a CodeSite installation is available: CodeSite->Installed()
            But is there also a call to check if the CodeSite Dispatcher actually started running?

            You wrote:
            When a program first tries to send a CodeSite message, the CodeSite logging class (TCodeSiteLogger) checks to see if the Dispatcher is running. If it is not, then the Dispatcher is started.

            How do you accomplish this?
            And do I have access to this function from my program?

            Kind regards,
            Hans Brand

             

          • #4566
            Ray Konopka
            Keymaster

              Hi Hans,
              In CS5, if you take a look at the CodeSiteLogging.pas unit, you will find the DispatcherIsRunning method in the TCodeSiteCopyDataConnection class. That method calls GetDispatcherWindow which calls FindWindow:
              Result := FindWindow( StrDispatcherFormClass, StrDispatcherFormCaption );
              So, while DispatcherIsRunning and GetDispatcherWindow are not public, you can basically do the same check yourself by calling FindWindow.

              Ray

            • #4567
              Hans Brand
              Participant

                Hi Ray,

                Succeeded to implement FindWindow(), thank you.

                Hans

                 

            Viewing 4 reply threads
            • You must be logged in to reply to this topic.