I tried to program an application interacting with TWS in C++ using the TWS Api from interactive brokers. If I run my program and try to connect TWS recognizes my connection attempt (a message box appears asking me wheter I want to connect or not) but immediately after my application crashes, every time. Here is the part I try to subclass EWrapper (in AutobotDlg.h) Code: class CAutobotDlg : public CDialog, public EWrapper { // Konstruktion public: CAutobotDlg(CWnd* pParent = NULL); // Standardkonstruktor // Dialogfelddaten enum { IDD = IDD_AUTOBOT_DIALOG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung // Implementierung protected: HICON m_hIcon; // Generierte Funktionen für die Meldungstabellen virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); //IB afx_msg void OnConnect(); //... afx_msg void OnMarketScanner(); //IB end DECLARE_MESSAGE_MAP() //IB void tickPrice( TickerId ddeId, TickType field, double price, int canAutoExecute); // ... void fundamentalData(TickerId reqId, const CString& data); //IB end public: afx_msg void OnBnClickedButton1(); private: EClient *m_pClient; }; Then I override the functions in AutobotDlg.cpp which includes AutobotDlg.h: Code: void CAutobotDlg::tickPrice( TickerId ddeId, TickType field, double price, int canAutoExecute) { } //... void CAutobotDlg::fundamentalData(TickerId reqId, const CString& data) { } And tried to connect with the following peaces also in AutobotDlg.cpp: Code: CAutobotDlg::CAutobotDlg(CWnd* pParent /*=NULL*/) : CDialog(CAutobotDlg::IDD, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); //Klient erstellen m_pClient = new EClientSocket(this); } void CAutobotDlg::OnBnClickedButton1() { m_pClient->eConnect("127.0.0.1", 7496, 0); } It would be very great if someone could help me, really thank you! I added some of the source files and the executable.