i have problem with the usercontrol not able to display in a html page...am not able to view in client machine..
i even user COMregisterfunction and COMUnregisterFunction.....can someone help me out with wat i need to change rom thic code...i got this code from internet.
ALso i want to know..whether do we need to register the dll on every machine in which the html page is ben viewed. if YES? then tell me how?
[ ComRegisterFunction() ]
public static void RegisterClass (string key_ ){
// Strip off HKEY_CLASSES_ROOT\ from the passed key as we don't need itStringBuilder sb =
new StringBuilder ( key_ ) ;sb.Replace(@"HKEY_CLASSES_ROOT\","B7E2C913-06D1-41e2-9A65-733995131C89") ;
// Open the CLSID\{guid} key for write accessRegistryKey regKey = Registry.ClassesRoot.OpenSubKey(sb.ToString(),
true); // And create the 'Control' key - this allows it to show up in // the ActiveX control containerRegistryKey ctrl = regKey.CreateSubKey ( "Control" ) ;
ctrl.Close ( ) ;
// Next create the CodeBase entry - needed if not string named and GACced.RegistryKey inprocServer32 = regKey.OpenSubKey ( "InprocServer32" ,
true ) ;inprocServer32.SetValue ( "CodeBase" , Assembly.GetExecutingAssembly().CodeBase ) ;
//MessageBox.Show( Assembly.GetExecutingAssembly().CodeBase );inprocServer32.Close ( ) ;
// Finally close the main keyregKey.Close ( ) ;
}
///[ComUnregisterFunction()]
public static void UnregisterClass ( string key_ ){
StringBuilder sb =
new StringBuilder ( key_ ) ;sb.Replace(@"HKEY_CLASSES_ROOT\","B7E2C913-06D1-41e2-9A65-733995131C89") ;
// Open HKCR\CLSID\{guid} for write accessRegistryKey regKey = Registry.ClassesRoot.OpenSubKey(sb.ToString(),
true); // Delete the 'Control' key, but don't throw an exception if it does not existregKey.DeleteSubKey ( "Control" ,
false ) ; // Next open up InprocServer32RegistryKey inprocServer32 = regKey.OpenSubKey ( "InprocServer32" ,
true ) ; // And delete the CodeBase key, again not throwing if missingregKey.DeleteSubKey ( "CodeBase" ,
false ) ; // Finally close the main keyregKey.Close ( ) ;
}
My html looks like this...
pls give me a solution..
Thanks,
yusuf
Replies
Know the answer? Post it — somebody with the same question will find it here.