I wrote an ActiveX Control (OCX) in native C++ using VS2008.
I can debug it correctly when I attach to the thread of Microsoft ActiveX control test container (TstCon32.exe) and my own native cpp application which references the control.
However, I can't debug it by attaching it to the thread of a .NET winform application referencing the control by MyCtrlNameLib.dll
and AxMyCtrlNameLib.dll
. It shows the following message on my break points:
The breakpoint will not currently be hit. No symbols have been loaded for this document. message
I wonder if there is a way to debug my ActiveX Control referenced by a .NET Winform application.
I think the problem is my .NET application isn't load MyCtrlName.ocx, and therefore no MyCtrlName.pdb is added. It load InterOp.MyCtrlNameLib.dll and AxInterOp.MyCtrlNameLib.dll instead.
Many thanks to @LihO point me a correct direction, I finally got it worked. The solution is really simple: Just go to property of my activeX control project. Under Debug branch, set "Debugger Type" to "Mixed" and all breakpoints can be hit.