Announcement

Collapse
No announcement yet.

.net sample? / instalaion?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • .net sample? / instalaion?

    Hi Members,

    Could someone instruct me how to install this ActiveX to C#.net?

    VisualStudio.net does not recognize the API file as ActiveX, and I am not sure what is the right way to implement it.

    I use InteractiveBrokers TWS API, and it can be simply appears in 'ToolBox' after a simple reference setting, but this eSignal ActiveX not.

    Thank you for any help.

    Regards,

    Ken

  • #2
    Ken,

    I'm not familiar enough with C# to be certain on this, but the below information should help.

    "Do a #import "winsig.tlb" in the stdafx.h, and then use Com smart pointers. For further reference on the subject, there are many articles and lessons on codeproject.com that discuss/teach how to do COM/ActiveX in VC."

    I hope this helps... if it does not, please let me know so we can research further for you.
    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment


    • #3
      Originally posted by JayF

      "Do a #import "winsig.tlb" in the stdafx.h, and then use Com smart pointers. For further reference on the subject, there are many articles and lessons on codeproject.com that discuss/teach how to do COM/ActiveX in VC."
      FWIW, the #import stuff above is for C++, not C#. To add the winsig stuff to your C# project, in the Solution Explorer right-click on the "References" folder and select "Add Reference" from the popup menu. Select the "COM" tab in the dialog and scroll down and souble click on "IESignal" in the list box so that it appears in the "Selected Components" area. Then click OK. If you don't see "IESignal" in the list box, you might need to click the "Browse..." button and find and select winsig.tlb yourself, after which it should appear.

      To instantiate and use it, you can do something like this:

      IESignal.HooksClass esignal = new IESignal.HooksClass();
      esignal.SetApplication("username");
      // yada yada yada

      Comment


      • #4
        Originally posted by GenSpoo
        FWIW, the #import stuff above is for C++, not C#. To add the winsig stuff to your C# project, in the Solution Explorer right-click on the "References" folder and select "Add Reference" from the popup menu. Select the "COM" tab in the dialog and scroll down and souble click on "IESignal" in the list box so that it appears in the "Selected Components" area. Then click OK. If you don't see "IESignal" in the list box, you might need to click the "Browse..." button and find and select winsig.tlb yourself, after which it should appear.

        To instantiate and use it, you can do something like this:

        IESignal.HooksClass esignal = new IESignal.HooksClass();
        esignal.SetApplication("username");
        // yada yada yada
        JayF, thank you for reply.

        GenSpoo,
        This really helps. Thank you.
        Actually, I could add the reference of IESignal, but was not sure how to use it in the code. I don't know why the ActiveX component usage is so different from IB-TWS one.
        Thanks again.

        Regards,

        Ken

        Comment


        • #5
          Another question if I may.

          Since this way doesn't show the ActiveX component in the ToolBar, it looks like I have to write Event code manually not automatically generated by VisualStudio.net unlike the ohter ActiveX around.

          Am I correct?

          Thank you.

          Ken

          Comment


          • #6
            Originally posted by kenokabe
            Since this way doesn't show the ActiveX component in the ToolBar, it looks like I have to write Event code manually not automatically generated by VisualStudio.net unlike the ohter ActiveX around.

            Am I correct?
            Not completely manually. For example, if you want to add a handler for OnBarsReceived, I do this assuming the below definition of the "esignal" object...

            type "esignal.OnBarsReceived +="

            After which DevStudio prompts me to hit tab to create a new handler object, so I hit tab. After that DevStudio prompts me to hit tab to auto-generate the wrapper handler function, so I hit tab. That's it. Pretty much everything is automated.

            Comment


            • #7
              Originally posted by GenSpoo
              Not completely manually. For example, if you want to add a handler for OnBarsReceived, I do this assuming the below definition of the "esignal" object...

              type "esignal.OnBarsReceived +="

              After which DevStudio prompts me to hit tab to create a new handler object, so I hit tab. After that DevStudio prompts me to hit tab to auto-generate the wrapper handler function, so I hit tab. That's it. Pretty much everything is automated.
              Oh right, I see now.
              Actually, I've never done this before. The other ActiveX I have used are shown in the ToolBox, and clicking the event category appeared in the list has done this process automatically. However, this also looks automated enough.
              I really appreciated your help.

              Best,

              Ken

              Comment


              • #8
                This is the difference between an ActiveX control (which you are expecting) and an ActiveX component.

                A control is something that can be dropped on a form. It may appear in the toolbox, if it is added. You drop the control on your form, then add code to the various properties and events of that control.

                A component, on the other hand, is simply an additional set of programming classes that allow you to perform some functionality. I am, in fact, very happy that eSignal decided to supply a component, rather than a form, because this allows you to access the API without having to have a form open to host the control. This means you could, for example, write a service application that runs in the background, without any user interface.

                It is unfortunate, however, that the eSignal application itself needs to open. I can understand the data manager needing to open, but I wish the application itself didn't need to.

                Dan

                Comment


                • #9
                  Dan,

                  Thanks for the informative comment. I understand this stuff more clearly now.

                  Regarding to the service without the form, I see your point.
                  However, I personally prefer the form because we already have so many services running background, and I don't want the eSignal receiver buried among them.
                  Probably you just can set up the application minimized in the taskbar as default.

                  Best,

                  Ken
                  Last edited by kenokabe; 08-13-2003, 01:43 AM.

                  Comment


                  • #10
                    Yes, in this case, a service may not make so much sense. But, in general, I prefer to have a service for server-type applications. While you can just minimize the application in the task bar, you would need to be logged onto the system in order to do it. You also could not log off the system without disrupting the application. With a service, you can have it run at system start, or turn it on programmatically, without requiring a user to be logged on to the system.

                    You could also have just a console app. There's no real need to load up all of the graphics resources if all you want to do is collect and crunch some numbers.

                    Anyway, I digress.

                    Comment

                    Working...
                    X