Hi,
We are trying to connect to eSignal ActiveX Desktop API from a Java application. When we connect to eSignal (demo) via
ActiveX, the eSignal application is being loaded succesfully, one can request eSignal software version via ActiveX or current time, but when we try to request a ticker, we get 'null'.
We are using this demo example:
, and added the following there:
m_app.IsValidSymbol("IBM");
m_app.XMLGetBasicQuote("IBM");
, and cannot get the data... Can please someone help?
Attached is our sample Java code.
package com.esignal.test;
import com.esignal.*;
/**
* This application uses the IBM Bridge2Java/Interface Tool to
* interact with the eSignal ActiveX interface.
*
* A set of Java classes were generated using the tool into
* the '../generated' directory, which allow us to instantiate
* and hook into the eSignal ActiveX interface.
*
* Note that the __MIDL__MIDL_itf_winsig_0000_0010 interface that
* we are using is to gain easy access to the constants specified
* (corresponds to the windowTypeFlags enum in the winsig.odl file).
*
* @author Dion Loy
* @date 2004/03/17
* @version 1.0
*/
public class eSignalTest implements __MIDL___MIDL_itf_winsig_0000_0010 {
/////////////////////////////////////////////////////////
// Private Fields
/** Our connection to the eSignal ActiveX interface. */
private Hooks m_app;
/////////////////////////////////////////////////////////
// Entry Point
/** The main entry point for our stand alone application. */
public static void main(String[] args) {
// instantiate our test object and start the test.
eSignalTest test = new eSignalTest();
test.start();
}
/////////////////////////////////////////////////////////
// Public Methods
/**
* Starts the ActiveX demo. We will attempt to connect to
* eSignal, and register for some quote updates.
*/
public void start() {
try {
// Initialize the Java2Com Environment
com.ibm.bridge2java.OleEnvironment.Initialize();
// Create a new eSignal hook.
m_app = new Hooks();
// Wait 5 seconds for eSignal to finish loading.
//Thread.sleep(5000);
m_app.SetApplication("USER_NAME");
System.out.println("Entitled: " + m_app.get_IsEntitled());
System.out.println("Title: " + m_app.get_GetTitle("IDC"));
System.out.println("Symbol: " + m_app.get_GetCurrentLinkingSymbol());
System.out.println("Version: " + m_app.get_GetAppBuildNumber());
// Wait 5 seconds for eSignal to finish loading.
Thread.sleep(1000);
System.out.println(m_app.IsValidSymbol("IBM") );
System.out.println(m_app.XMLGetBasicQuote("IBM"));
// launch Advanced Charts
m_app.CreateNewWindow(wtfADVANCEDCHART, 0, 0, 400, 300, 0, "QQQ");
// launch Time & Sales
m_app.CreateNewWindow(wtfTIMESALES, 401, 0, 200, 500, 0, "QQQ");
// launch News
m_app.CreateNewWindow(wtfSTORY, 0, 301, 400, 200, 0, "QQQ");
// launch Option Chains
m_app.CreateNewWindow(wtfOPTIONS, 502, 0, 600, 200, 0, "QQQ");
// Wait 10 seconds.
Thread.sleep(10000);
} catch (com.ibm.bridge2java.ComException e) {
System.out.println( "COM Exception:" );
System.out.println( Long.toHexString((e.getHResult())) );
System.out.println( e.getMessage() );
} catch (Exception e) {
System.out.println("message: " + e.getMessage());
} finally {
// null out our app reference to get it GC'd.
m_app = null;
// uninitialize the OLE bridge.
com.ibm.bridge2java.OleEnvironment.UnInitialize();
}
}
}
Thanks,
Marco
We are trying to connect to eSignal ActiveX Desktop API from a Java application. When we connect to eSignal (demo) via
ActiveX, the eSignal application is being loaded succesfully, one can request eSignal software version via ActiveX or current time, but when we try to request a ticker, we get 'null'.
We are using this demo example:
, and added the following there:
m_app.IsValidSymbol("IBM");
m_app.XMLGetBasicQuote("IBM");
, and cannot get the data... Can please someone help?
Attached is our sample Java code.
package com.esignal.test;
import com.esignal.*;
/**
* This application uses the IBM Bridge2Java/Interface Tool to
* interact with the eSignal ActiveX interface.
*
* A set of Java classes were generated using the tool into
* the '../generated' directory, which allow us to instantiate
* and hook into the eSignal ActiveX interface.
*
* Note that the __MIDL__MIDL_itf_winsig_0000_0010 interface that
* we are using is to gain easy access to the constants specified
* (corresponds to the windowTypeFlags enum in the winsig.odl file).
*
* @author Dion Loy
* @date 2004/03/17
* @version 1.0
*/
public class eSignalTest implements __MIDL___MIDL_itf_winsig_0000_0010 {
/////////////////////////////////////////////////////////
// Private Fields
/** Our connection to the eSignal ActiveX interface. */
private Hooks m_app;
/////////////////////////////////////////////////////////
// Entry Point
/** The main entry point for our stand alone application. */
public static void main(String[] args) {
// instantiate our test object and start the test.
eSignalTest test = new eSignalTest();
test.start();
}
/////////////////////////////////////////////////////////
// Public Methods
/**
* Starts the ActiveX demo. We will attempt to connect to
* eSignal, and register for some quote updates.
*/
public void start() {
try {
// Initialize the Java2Com Environment
com.ibm.bridge2java.OleEnvironment.Initialize();
// Create a new eSignal hook.
m_app = new Hooks();
// Wait 5 seconds for eSignal to finish loading.
//Thread.sleep(5000);
m_app.SetApplication("USER_NAME");
System.out.println("Entitled: " + m_app.get_IsEntitled());
System.out.println("Title: " + m_app.get_GetTitle("IDC"));
System.out.println("Symbol: " + m_app.get_GetCurrentLinkingSymbol());
System.out.println("Version: " + m_app.get_GetAppBuildNumber());
// Wait 5 seconds for eSignal to finish loading.
Thread.sleep(1000);
System.out.println(m_app.IsValidSymbol("IBM") );
System.out.println(m_app.XMLGetBasicQuote("IBM"));
// launch Advanced Charts
m_app.CreateNewWindow(wtfADVANCEDCHART, 0, 0, 400, 300, 0, "QQQ");
// launch Time & Sales
m_app.CreateNewWindow(wtfTIMESALES, 401, 0, 200, 500, 0, "QQQ");
// launch News
m_app.CreateNewWindow(wtfSTORY, 0, 301, 400, 200, 0, "QQQ");
// launch Option Chains
m_app.CreateNewWindow(wtfOPTIONS, 502, 0, 600, 200, 0, "QQQ");
// Wait 10 seconds.
Thread.sleep(10000);
} catch (com.ibm.bridge2java.ComException e) {
System.out.println( "COM Exception:" );
System.out.println( Long.toHexString((e.getHResult())) );
System.out.println( e.getMessage() );
} catch (Exception e) {
System.out.println("message: " + e.getMessage());
} finally {
// null out our app reference to get it GC'd.
m_app = null;
// uninitialize the OLE bridge.
com.ibm.bridge2java.OleEnvironment.UnInitialize();
}
}
}
Thanks,
Marco
Comment