Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two ActiveX questions

Status
Not open for further replies.

B00gyeMan

Programmer
Jan 14, 2004
259
0
0
RO
Question 1:
I have an assembly writen in c#, marked COM visible. And a CAB setup project containing the project output of that assembly. Typically, the .aspx page contains a <object id="myControl1" name="myControl1" classid="...guid...here..." style="width:100%; height:100%" codebase="myCAB.cab"></object>

First time IE automatically informs user that i'm trying to install an ActiveX control and presents him with the dialog "Do you want to install ActiveX control...." and if the user agrees, IE installs the files in the CAB archive. It successfully extracts my assembly. But that is not enough, I have to run "regasm myAssembly.dll /codebase" in order for registry entries to be created to be used by the CCW mscoree creates for IE. How to I do that? How do I tell the setup CAB project to register my assembly via regasm on the client's machine?



Question 2:
In an .aspx page I have a
Code:
<object ID="myControl1" classid="CLSID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"></object> tag, and a button
<input type="button" value="Pushme" onClick="myControl1.PublicMethod();"/>

When I push the button i get the typical "Object does not support this property or method" JS error. If I do it using
Code:
var obj = new ActiveXObject( ...);
obj.PublicMethod();
it works. But I need to embed the control in the page as specified above because that is the only way I can register JavaScript handlers to ActiveX events. How do I call methods from myControl1 ActiveX object?


Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top