views:

17

answers:

0

I have a 3rd party ActiveX control built in VB6 which I need to use in an ASP.NET web application. But as the ActiveX is using window handles as parameters to method calls, I am not sure how to do that in a web browser as we do not have windows controls and hence no handles in web applications.

The ActiveX provides methods like: long AddObject (long * obj_handle, long window_handle, BSTR dev_name, short obj_id)

Any idea on what value can I pass for window handle?

As a workaround, I created a Windows Forms Control Library project, placed this VB6 ActiveX control on it and provided wrapper public methods which internally calls methods of ActiveX control. Which solves the handles problem as now I can supply the window handle. This Windows control works fine when placed on a Windows Forms client. Now I placed this winform control on asp.net page like this:

But the browser (IE) does not load the Winform control and shows empty area with a small icon probably because it is unable to load the dependent assemblies as MyWinFormsProject.dll is referencing ActiveX assemblies.

Now the issue is I can specify only 1 dll above so how to specify multiple assemblies. For this I used ILMerge and merged the dependent assemblies and MyWinFormsProject.dll to create a single dll named as MyMergedProject.dll and used it like this:

But still it does not solve the problem and IE shows empty area and does not load the winform control. Please help to approach this issue or how to get a VB6 ActiveX control working in ASP.NET application as I am stuck on this task. Thanks.

Platform used: VS2010, .Net4.0, IIS7