wxuf
March 3rd, 2006, 07:30 AM
First I will introduce what i am doing ...
I create a project (application) under .net 2005, in which a webbrowser control is added to the main form, and then an html file (static page) is displayed in the webbrowser control. In this html page, an "activex" control is referenced. Several java script code is used to communicate between the activex control and the page.
About the "activex" control under .net environment, i give the explanation below:
here the case is a little complicated. this "activex" control is a user-defined control and is built as an assembly file. I add this assemly file to GAC, and registe it by "regasm", so it is registed as an activex control).
and now comes the annoying thing: when I run the application by " start debugging" (Or F5), the page is displayed and works well. But when I run the application by "start without debuging" an message box appeared and this activex doesn't work.
I don't know what the problem is, and hopefully you may get out of this struggle.
I attached the project, and i think it is a quite interesting project.
Things to be careful:
1. after you install the assembly file to GAC, use "regasm" to register it into
register ( of course this assembly file is safe ! )
2. You may need to find the "ClassId" by search the registery ("Prisoner" I name it)
3. this classId is used in the html file for i use this classid to reference this control object.
4. Build the projects.
5. files:
WebBrowser.rar: example to browse an html;
PrisonerAssembly.rar: activex project
Howtodoregiste.aspx.htm;
How To Install an Assembly in the Global Assembly Cache in Visual Basic .NET.htm
I create a project (application) under .net 2005, in which a webbrowser control is added to the main form, and then an html file (static page) is displayed in the webbrowser control. In this html page, an "activex" control is referenced. Several java script code is used to communicate between the activex control and the page.
About the "activex" control under .net environment, i give the explanation below:
here the case is a little complicated. this "activex" control is a user-defined control and is built as an assembly file. I add this assemly file to GAC, and registe it by "regasm", so it is registed as an activex control).
and now comes the annoying thing: when I run the application by " start debugging" (Or F5), the page is displayed and works well. But when I run the application by "start without debuging" an message box appeared and this activex doesn't work.
I don't know what the problem is, and hopefully you may get out of this struggle.
I attached the project, and i think it is a quite interesting project.
Things to be careful:
1. after you install the assembly file to GAC, use "regasm" to register it into
register ( of course this assembly file is safe ! )
2. You may need to find the "ClassId" by search the registery ("Prisoner" I name it)
3. this classId is used in the html file for i use this classid to reference this control object.
4. Build the projects.
5. files:
WebBrowser.rar: example to browse an html;
PrisonerAssembly.rar: activex project
Howtodoregiste.aspx.htm;
How To Install an Assembly in the Global Assembly Cache in Visual Basic .NET.htm