Debug ActiveX Control Using VS2010

来源:互联网 发布:苏州公司网络注册 编辑:程序博客网 时间:2024/06/01 10:14

Method 1:

Link:Debugging COM and ActiveX

Link:How to: Debug an ActiveX Control

Step1:Code test html.

<HTML><HEAD><TITLE>Test ActiveX</TITLE></HEAD><BODY><OBJECT ID="MyActiveX" WIDTH=800 HEIGHT=600 CLASSID="CLSID:5228A02F-8FBD-424C-B457-EEBD4E748504"><PARAM NAME="_Version" VALUE="65536"><PARAM NAME="_ExtentX" VALUE="4657"><PARAM NAME="_ExtentY" VALUE="4075"><PARAM NAME="_StockProps" VALUE="0"></OBJECT></BODY></HTML>


Step2:Set debug option in VS2010.

Right click the project and select "Properties" tab. Then select Debugging item in the Properties Pages and configure "Command" and "CommandArgs" arguments.

command: C:/Program Files/Internet Explorer/iexplore.exe  (Local IE path)

command arguments: C:/test.htm (test.html file path)


Step3: Register ActiveX control using full path.

If not, there will be an error:The sepcified module could not be found.


Step4: Sep break point in VS2010 where the implement code you want to debug. Then press F5 to run the program.


Note:IE8 is multi-thread by default, doesn't support ActiveX debug. So, you must modify the registry as following:

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]

"TabProcGrowth"=dword:00000000


Note:For Win7 x64 and IE11

1.Run regedit and search [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main], then create or update a DWORD(32) value named TabProcGrowth and set value to 1.(In this case,if newing a tab page will start a 32bit ieplore*32)

2.Attach to a x86 ieplore.exe process, then you will debug into breakpoint.

Referrence:

http://www.iefans.net/win7-win8-dakai-32wei-ie10-ie11/

http://stackoverflow.com/questions/17840884/debugging-32-bit-activex-control-with-visual-studio-2008-and-ie-10

http://stackoverflow.com/questions/3021371/can-no-longer-debug-activex-controls-in-visual-studio-2008?rq=1

http://stackoverflow.com/questions/3021371/can-no-longer-debug-activex-controls-in-visual-studio-2008

http://support.microsoft.com/kb/2716529/zh-cn


原创粉丝点击