Connect to ThinkOrSwim using NDDE in .Net
Asked Answered
C

2

6

I am successfully receiving DDE data from the ThinkOrSwim trading platform into excel using this cell formula:

=TOS|Last!AAPL

However, when I try to connect to ThinkOrSwim DDE using the NDDE library in a .Net C# application, I receive the following error message, which is the same as I would get if the ThinkOrSwim platform was not running at all:

The client failed to connect to "TOS|LAST". Make sure the server application is running and that it supports the specified service name and topic name pair.

The exact same method of connecting with NDDE worked in 2009, and failed when I re-utilised it in 2012. Perhaps ThinkOrSwim have made some change in their application to block it? I'm wondering what to do next ... either find a way to make NDDE work (better), or run an excel spreadsheet inside my .Net application (messy).

Hoping someone here knows I way I can continue using NDDE and fix that connection problem.

Click to download small code library I created to demonstrate this problem (Visual Studio 2010). You will have to click File->Download after the page loads.

Bounty is only for answers showing a solution that uses a pure .Net / windows api solution. Automating excel within .Net is not accepted for the bounty.

Download ThinkOrSwim from: https://mediaserver.thinkorswim.com/installer/InstFiles/thinkorswim_jse6_installer.exe Contact me privately if you need to for login details.

Crespi answered 9/8, 2012 at 23:50 Comment(0)
C
1

Finally found a solution: I had to run Visual Studio as administrator to get it to work in debug. To make the .exe work, I had to add an app.manifest file with the following:

  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
     <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
Crespi answered 19/8, 2012 at 1:29 Comment(0)
I
3

Right Click on thinkorswim.exe , go to the compatibility tab

check the "Run as Administrator" box at the bottom.

Click Apply.

Irresistible answered 13/8, 2012 at 3:50 Comment(1)
Thanks Charvind, this was pretty close to the answer I needed. See mine below.Crespi
C
1

Finally found a solution: I had to run Visual Studio as administrator to get it to work in debug. To make the .exe work, I had to add an app.manifest file with the following:

  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
     <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
Crespi answered 19/8, 2012 at 1:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.