Click to See Complete Forum and Search --> : Start debuging AND start without debugging ! what is the matter ?


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

wxuf
March 3rd, 2006, 07:34 AM
Sorry, forget the test html file ;


<html>
<script language = "javascript">
function doScript()
{
 MyControl1.UserText = txt.value;
MyControl1.AddToList( txt.value ) ;
}
</script>

<body color = white>
<hr>
<table>
<tr><td height=25>
<OBJECT id = "MyControl1" name = "MyControl1" classid = "CLSID:2B51CAB4-D4D2-3251-9E65-022102180C52" width = 250 height = 35 >
<!-- <OBJECT id = "MyControl1" name = "MyControl1" classid = "Prisoner.dll#Prisoner.PrisonerControl" width = 100 height = 25 > -->
</OBJECT>
</td>
<tr><td>
Please Input the data :<input type = "text" name = "txt" value = ""><input type = button value = "OK" onClick = "doScript() ; ">
</td></tr>
<hr>
</body>
</html>


It's a little complicate, please keep your patience.
thank you very much ! Wish a better day !

wxuf