Debug ActiveX Control Using VS2010

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值