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:
- Compile the C++ DLL in Visual Studio 2022 in RELEASE mode as specified for use in tradestation.
- Set post build to copy MyDLL.dll and MyDLL.pdb to C:\Program Files (x86)\TradeStation 10.0\Program
- Indicator using function from MyDLL.dll plots ok - great!
- Set breakpoint in C++ code within function in Visual Studio 2022: breakpoint shows no errors.
- 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 ++++++++
- MyDLL.dll not listed in Modules window
- 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. - 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