Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C++ DLL Debugging - Visual Studio 2022

C++ DLL Debugging - Visual Studio 2022

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiodebuggingannouncementcsharpc++
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PaulS_UK
    wrote on last edited by
    #1

    Can someone please tell me how I can debug a C++ DLL from within Tradestation 10 by attaching VS2022 to the Tradestation process?

    I can compile a DLL successfully and call a function from it for display within a Tradestation workspace. After a LOT of time spent browsing around on various MicroSoft learning pages etc etc, I have arrived at the following method but cannot get Visual Studio 2022 to load symbols or recognize the required .PDB file(s).

    To complicate matters the DLL must be a release version and reside in the Tradestation system file for it to work with Tradestation. It is my understanding that this is ok so long as the relevent .pdb files are available to enable debugging. Here is my methodology so far:

    1. Compile the C++ DLL in Visual Studio 2022 in RELEASE mode as specified for use in tradestation.
    2. Set post build to copy MyDLL.dll and MyDLL.pdb to C:\Program Files (x86)\TradeStation 10.0\Program
    3. Indicator using function from MyDLL.dll plots ok - great!
    4. Set breakpoint in C++ code within function in Visual Studio 2022: breakpoint shows no errors.
    5. Attempt to debug in release mode in VS 2022 by attaching Tradestation process using indicator/MyDLL to be debugged: Debug -> Attach to Process... -> ORPlat.exe

    ++++ Now things do not go to plan ++++++++

    1. MyDLL.dll not listed in Modules window
    2. Numerous messages appear in the Modules window such as:
      ORPlat.exe C:\Program Files (x86)\TradeStation 10.0\Program\ORPlat.exe Cannot find or open the PDB file.
    3. MyDLL.dll shows up as being loaded ok using DebugView

    Compiler settings in VS2022 are:

    /ifcOutput "Release\" /GS /GL /analyze- /W3 /Gy /Zc:wchar_t /Zi /Gm- /Od /Fd"Release\vc143.pdb" /Zc:inline /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "GLOBALVARIABLE23_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MT /FC /Fa"Release\" /EHsc /nologo /Fo"Release\" /Ot /Fp"Release\Future DLL.pch" /diagnostics:column

    Am I flogging a dead horse here? Is it impossible to debug MyDLL.dll from within Visual Studio by attaching it to the Tradestation process (ORPlat.exe)? If it is not possible (such as debugging only from within Tradestation; how do you attempt serious debugging in complex C++ code within your MyDLL.dll functions?

    Any help on this greatly appreciated!

    Cheers

    Richard Andrew x64R 1 J 3 Replies Last reply
    0
    • P PaulS_UK

      Can someone please tell me how I can debug a C++ DLL from within Tradestation 10 by attaching VS2022 to the Tradestation process?

      I can compile a DLL successfully and call a function from it for display within a Tradestation workspace. After a LOT of time spent browsing around on various MicroSoft learning pages etc etc, I have arrived at the following method but cannot get Visual Studio 2022 to load symbols or recognize the required .PDB file(s).

      To complicate matters the DLL must be a release version and reside in the Tradestation system file for it to work with Tradestation. It is my understanding that this is ok so long as the relevent .pdb files are available to enable debugging. Here is my methodology so far:

      1. Compile the C++ DLL in Visual Studio 2022 in RELEASE mode as specified for use in tradestation.
      2. Set post build to copy MyDLL.dll and MyDLL.pdb to C:\Program Files (x86)\TradeStation 10.0\Program
      3. Indicator using function from MyDLL.dll plots ok - great!
      4. Set breakpoint in C++ code within function in Visual Studio 2022: breakpoint shows no errors.
      5. Attempt to debug in release mode in VS 2022 by attaching Tradestation process using indicator/MyDLL to be debugged: Debug -> Attach to Process... -> ORPlat.exe

      ++++ Now things do not go to plan ++++++++

      1. MyDLL.dll not listed in Modules window
      2. Numerous messages appear in the Modules window such as:
        ORPlat.exe C:\Program Files (x86)\TradeStation 10.0\Program\ORPlat.exe Cannot find or open the PDB file.
      3. MyDLL.dll shows up as being loaded ok using DebugView

      Compiler settings in VS2022 are:

      /ifcOutput "Release\" /GS /GL /analyze- /W3 /Gy /Zc:wchar_t /Zi /Gm- /Od /Fd"Release\vc143.pdb" /Zc:inline /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "GLOBALVARIABLE23_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MT /FC /Fa"Release\" /EHsc /nologo /Fo"Release\" /Ot /Fp"Release\Future DLL.pch" /diagnostics:column

      Am I flogging a dead horse here? Is it impossible to debug MyDLL.dll from within Visual Studio by attaching it to the Tradestation process (ORPlat.exe)? If it is not possible (such as debugging only from within Tradestation; how do you attempt serious debugging in complex C++ code within your MyDLL.dll functions?

      Any help on this greatly appreciated!

      Cheers

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      PaulS_UK wrote:

      6. MyDLL.dll not listed in Modules window

      Sounds to me like your DLL is not being loaded by the process. Is there something you need to do to cause it to load the DLL, like maybe use a particular feature?

      The difficult we do right away... ...the impossible takes slightly longer.

      1 Reply Last reply
      0
      • P PaulS_UK

        Can someone please tell me how I can debug a C++ DLL from within Tradestation 10 by attaching VS2022 to the Tradestation process?

        I can compile a DLL successfully and call a function from it for display within a Tradestation workspace. After a LOT of time spent browsing around on various MicroSoft learning pages etc etc, I have arrived at the following method but cannot get Visual Studio 2022 to load symbols or recognize the required .PDB file(s).

        To complicate matters the DLL must be a release version and reside in the Tradestation system file for it to work with Tradestation. It is my understanding that this is ok so long as the relevent .pdb files are available to enable debugging. Here is my methodology so far:

        1. Compile the C++ DLL in Visual Studio 2022 in RELEASE mode as specified for use in tradestation.
        2. Set post build to copy MyDLL.dll and MyDLL.pdb to C:\Program Files (x86)\TradeStation 10.0\Program
        3. Indicator using function from MyDLL.dll plots ok - great!
        4. Set breakpoint in C++ code within function in Visual Studio 2022: breakpoint shows no errors.
        5. Attempt to debug in release mode in VS 2022 by attaching Tradestation process using indicator/MyDLL to be debugged: Debug -> Attach to Process... -> ORPlat.exe

        ++++ Now things do not go to plan ++++++++

        1. MyDLL.dll not listed in Modules window
        2. Numerous messages appear in the Modules window such as:
          ORPlat.exe C:\Program Files (x86)\TradeStation 10.0\Program\ORPlat.exe Cannot find or open the PDB file.
        3. MyDLL.dll shows up as being loaded ok using DebugView

        Compiler settings in VS2022 are:

        /ifcOutput "Release\" /GS /GL /analyze- /W3 /Gy /Zc:wchar_t /Zi /Gm- /Od /Fd"Release\vc143.pdb" /Zc:inline /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "GLOBALVARIABLE23_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MT /FC /Fa"Release\" /EHsc /nologo /Fo"Release\" /Ot /Fp"Release\Future DLL.pch" /diagnostics:column

        Am I flogging a dead horse here? Is it impossible to debug MyDLL.dll from within Visual Studio by attaching it to the Tradestation process (ORPlat.exe)? If it is not possible (such as debugging only from within Tradestation; how do you attempt serious debugging in complex C++ code within your MyDLL.dll functions?

        Any help on this greatly appreciated!

        Cheers

        1 Offline
        1 Offline
        11917640 Member
        wrote on last edited by
        #3

        Try this way: Change Dll project by such way, that it builds the library and pdb directly to Tradestation plugin directory. Build the project. Select ORPlat.exe as executable for debugging. Start debugging. Now, that ORPlat.exe loads your library, Output window should show "library loaded" message. Is debugging information loaded? If debugging information is not loaded, try to enable Microsoft Symbol Server. Also, check, whether your library is loaded from TradeStation directory. Maybe it is loaded from some other location? To check, remove the library and see, that it stops working.

        1 Reply Last reply
        0
        • P PaulS_UK

          Can someone please tell me how I can debug a C++ DLL from within Tradestation 10 by attaching VS2022 to the Tradestation process?

          I can compile a DLL successfully and call a function from it for display within a Tradestation workspace. After a LOT of time spent browsing around on various MicroSoft learning pages etc etc, I have arrived at the following method but cannot get Visual Studio 2022 to load symbols or recognize the required .PDB file(s).

          To complicate matters the DLL must be a release version and reside in the Tradestation system file for it to work with Tradestation. It is my understanding that this is ok so long as the relevent .pdb files are available to enable debugging. Here is my methodology so far:

          1. Compile the C++ DLL in Visual Studio 2022 in RELEASE mode as specified for use in tradestation.
          2. Set post build to copy MyDLL.dll and MyDLL.pdb to C:\Program Files (x86)\TradeStation 10.0\Program
          3. Indicator using function from MyDLL.dll plots ok - great!
          4. Set breakpoint in C++ code within function in Visual Studio 2022: breakpoint shows no errors.
          5. Attempt to debug in release mode in VS 2022 by attaching Tradestation process using indicator/MyDLL to be debugged: Debug -> Attach to Process... -> ORPlat.exe

          ++++ Now things do not go to plan ++++++++

          1. MyDLL.dll not listed in Modules window
          2. Numerous messages appear in the Modules window such as:
            ORPlat.exe C:\Program Files (x86)\TradeStation 10.0\Program\ORPlat.exe Cannot find or open the PDB file.
          3. MyDLL.dll shows up as being loaded ok using DebugView

          Compiler settings in VS2022 are:

          /ifcOutput "Release\" /GS /GL /analyze- /W3 /Gy /Zc:wchar_t /Zi /Gm- /Od /Fd"Release\vc143.pdb" /Zc:inline /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "GLOBALVARIABLE23_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MT /FC /Fa"Release\" /EHsc /nologo /Fo"Release\" /Ot /Fp"Release\Future DLL.pch" /diagnostics:column

          Am I flogging a dead horse here? Is it impossible to debug MyDLL.dll from within Visual Studio by attaching it to the Tradestation process (ORPlat.exe)? If it is not possible (such as debugging only from within Tradestation; how do you attempt serious debugging in complex C++ code within your MyDLL.dll functions?

          Any help on this greatly appreciated!

          Cheers

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #4

          PaulS_UK wrote:

          how do you attempt serious debugging in complex C++ code within your MyDLL.dll functions

          Any language - I use logging. Last time I did C++ I rolled my own. But googling I see Log4cxx and Log4cpp. I might go with the second but I would do more research first.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups