Announcement

Collapse
No announcement yet.

stopping eSignal

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

  • stopping eSignal

    dear experts,

    I'm trying to integrate eSignal 7.5 inside a simple Java application.
    I need help about a simple problem that occours everytime I start eSignal from my java application.

    These are the steps I followed:

    1. Run j2cgen.exe against IESignal 1.0 library (see j2cgen.gif attachment) including all Interfaces
    2. Create the java class UseHooks that implements _IHooksEvents_If
    3. Running UseHooks

    This is the java code:

    package it.soltec.t3.ie_signal;

    import com.neva.COMClassObject;
    import com.neva.COMException;
    import com.neva.COMHResult;
    import com.neva.COMIConnectionPoint;
    import com.neva.COMIConnectionPointContainer;
    import com.neva.COMSafeArray;
    import com.neva.COMStdDispatch;
    import com.neva.GUID;

    public class UseHooks implements _IHooksEvents_If{
    public IHooks m_object;
    private COMIConnectionPoint m_cp;
    private COMStdDispatch m_dspSink;
    public int m_cpCookie;
    COMIConnectionPointContainer cpc;

    public UseHooks() throws Exception {
    createObject();
    }

    private void createObject() throws Exception{
    m_object = new IHooks();
    GUID clsid = GUID.CLSIDFromProgID("IESignal.Hooks");
    m_object.CoCreateInstance(clsid,COMClassObject.LOC AL_SERVER);
    cpc = new COMIConnectionPointContainer();
    m_object.QueryInterface(cpc);
    m_cp = cpc.FindConnectionPoint(_IHooksEvents_If.IID);
    cpc.Release();
    m_dspSink = _IHooksEvents.BuildDispinterfaceSink(this);
    m_cpCookie = m_cp.Advise(m_dspSink);
    System.out.println(m_object.GetGetAppBuildNumber() );
    System.out.println(m_object.GetGetAppVersion());
    System.out.println(m_object.GetGetAppTime());
    }

    public static void main(String[] args) {
    try {
    COMClassObject.CoInitialize(COMClassObject.MULTITH READED);
    UseHooks me = new UseHooks();
    } catch (Exception e) {
    e.printStackTrace();
    System.exit(0);
    }
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnSymbolCh anged(java.lang.String)
    */
    public COMHResult OnSymbolChanged(String _sSymbol) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnQuoteCha nged(java.lang.String)
    */
    public COMHResult OnQuoteChanged(String _sSymbol) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnBarsChan ged(int)
    */
    public COMHResult OnBarsChanged(int _lHandle) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnBarsRece ived(int)
    */
    public COMHResult OnBarsReceived(int _lHandle) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnPlaceOrd er(java.lang.String)
    */
    public COMHResult OnPlaceOrder(String _sXML) {
    System.out.println(_sXML);
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnCancelAl lOrders()
    */
    public COMHResult OnCancelAllOrders() {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnCancelOr derByOrderID(java.lang.String)
    */
    public COMHResult OnCancelOrderByOrderID(String _sOrderID) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnCancelOr der(java.lang.String)
    */
    public COMHResult OnCancelOrder(String _sSymbol) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnClosePos ition(java.lang.String)
    */
    public COMHResult OnClosePosition(String _sSymbol) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnCloseAll Positions()
    */
    public COMHResult OnCloseAllPositions() {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnCancelAn dReplace(java.lang.String, double, double, double)
    */
    public COMHResult OnCancelAndReplace(String _sOrderID, double _dQuantity, double _dLimitPrice, double _dStopPrice) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnTimeSale sChanged(int)
    */
    public COMHResult OnTimeSalesChanged(int _lHandle) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnWindowOp en(int, int, int)
    */
    public COMHResult OnWindowOpen(int _hWND, int _hParentWnd, int _wtf) {
    System.out.println("OnWindowOpen");
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnWindowCl osing(int, int, int)
    */
    public COMHResult OnWindowClosing(int _hWND, int _hParentWnd, int _wtf) {
    System.out.println("OnWindowClosing");
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnWindowPo sChanging(int, int, int)
    */
    public COMHResult OnWindowPosChanging(int _hWND, int _hParentWnd, int _wtf) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnSavingLa youtOrPage(java.lang.String)
    */
    public COMHResult OnSavingLayoutOrPage(String _sLayout) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnLoadingL ayoutOrPage(java.lang.String)
    */
    public COMHResult OnLoadingLayoutOrPage(String _sLayout) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnAppClosi ng()
    */
    public COMHResult OnAppClosing() {
    System.out.println("OnAppClosing");
    try {
    m_cp.Unadvise(m_cpCookie);
    m_cp.Release();
    m_dspSink.Release();
    } catch (COMException e) {
    e.printStackTrace();
    }
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnSymbolGr oupChangeEvent(java.lang.String, int, int)
    */
    public COMHResult OnSymbolGroupChangeEvent(String _sSymbol, int _lGroupNum, int _crGroupColor) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnInterval GroupChangeEvent(java.lang.String, int, int)
    */
    public COMHResult OnIntervalGroupChangeEvent(String _sSymbol, int _lGroupNum, int _crGroupColor) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnWindowSy mbolChange(int, int, java.lang.String, int)
    */
    public COMHResult OnWindowSymbolChange(int _hWND, int _hParentWnd, String _sSymbol, int _wtf) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnBrokerMa inMenuCommand(java.lang.String)
    */
    public COMHResult OnBrokerMainMenuCommand(String _sMenuCommandKey) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnBrokerCo ntextMenuCommand(java.lang.String, com.neva.COMSafeArray[])
    */
    public COMHResult OnBrokerContextMenuCommand(String _sContextCommandKey, COMSafeArray[] _ppsaRowKeys) {
    return null;
    }

    /* (non-Javadoc)
    * @see it.soltec.t3.ie_signal._IHooksEvents_If#OnBrokerRo wDblClick(java.lang.String, java.lang.String)
    */
    public COMHResult OnBrokerRowDblClick(String _sCategoryKey, String _sRowKey) {
    return null;
    }
    }


    When I run UseHooks, eSignal starts correctly but, when I exit from eSignal, I see the winsig.exe process already active in the windows task manager.

    How can I fix this problem?

    Thanks in advance

    best regards

    Giovanni Regola
    Attached Files

  • #2
    Giovanni,

    I'm not sure I understand the symptom of the problem. You said that eSignal starts up fine when using your application, but when you exit eSignal, you still see winsig.exe in Task Manager? Is that correct?

    I actually am able to see this as well by doing the following.

    1) Start VB sample app (w/ eSignal not already open)
    - eSignal opens as does the sample app
    2) Close eSignal via File --> Exit
    3) Check Task Manager
    - Winsig.exe is still present

    Upon closing the sample app, winsig.exe will disappear from the Task Manager, so it seems that having an application open that is built using the Desktop API will keep winsig.exe open after it is manually closed.

    Giovanni, could you describe how this impacts you?

    Thanks.
    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment


    • #3
      Re: Reply to post 'stopping eSignal'

      Yes,
      eSignal starts up fine when my java application starts, but when I exit eSignal, I still see winsig.exe in Task Manager.
      You say that "it seems that having an application open that is built using the Desktop API will keep winsig.exe open after it is manually closed", but even if I exit my java app, winsig.exe still runs in Task Manager.
      These are 2 scenarios I tested :

      SCENARIO A:
      - I run myApp
      - myApp starts eSignal
      - I exit eSignal
      - I close myApp

      but eSignal is still running (I can see it from task manager)

      SCENARIO B:
      - I run eSignal
      - I run myApp
      - myApp connects to eSignal
      - I exit eSignal
      - I close myApp

      but eSignal is still running (I can see it from task manager)

      Some informations about my app:
      myApp needs to have a listener to eSignal in order to get asynchronous events from eSignal (i.e. trade order)

      I send you an attachment including jar and bat file for testing my app (and also java files).

      I hope you can help me to solve this problem

      best regards

      Giovanni Regola
      Last edited by gio2003; 02-03-2004, 08:57 AM.

      Comment


      • #4
        sorry,
        I forgot the attachment...

        Giovanni Regola
        Attached Files

        Comment


        • #5
          I haven't had a chance to test your app yet, but in looking at the .jar I see no ReleaseSymbol() or ReleaseHistory(). I tested this theory using VB and removing the Release functions from the VB Sample, and Winsig.exe closed under both scenarios, but perhaps Java is different?

          Try incorporating ReleaseSymbol() and/or ReleaseHistory() upon the closing of your app, and see if that solves it.
          Regards,
          Jay F.
          Product Manager
          _____________________________________
          Have a suggestion to improve our products?
          Click Support --> Request a Feature in eSignal 11

          Comment

          Working...
          X