I have created a very simple user control ActiveX with a simple button that show up a MessageBox.
namespace AxCPW
{
public partial class Test: UserControl, ITest
{
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello World");
}
}
}
Next I have created a web page inside my asp.net project and i have embedded my usercontrol in it.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<object id="myControl" name="myControl" classid="AxCPW.dll#AxCPW.Test" width="100" height="100">
</object>
</body>
</html>
The problem is i see a broken image instead my UserControl, i have already added my localhost web server Trusted Sites on IE9 but doesn't works.
I know ActiveX is an obsolete solution, but i need to use a third part sdk dll (to communicate with a device by USB) and i think the only available solution is this