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 it
StringBuilder sb = new StringBuilder ( key_ ) ;
sb.Replace(@"HKEY_CLASSES_ROOT\","B7E2C913-06D1-41e2-9A65-733995131C89") ;
// Open the CLSID\{guid} key for write access
RegistryKey regKey = Registry.ClassesRoot.OpenSubKey(sb.ToString(),true);
// And create the 'Control' key - this allows it to show up in
// the ActiveX control container
RegistryKey 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 key
regKey.Close ( ) ;
}
///
/// Called to unregister the control
///
/// Tke registry key
[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 access
RegistryKey regKey = Registry.ClassesRoot.OpenSubKey(sb.ToString(),true);
// Delete the 'Control' key, but don't throw an exception if it does not exist
regKey.DeleteSubKey ( "Control" , false ) ;
// Next open up InprocServer32
RegistryKey inprocServer32 = regKey.OpenSubKey ( "InprocServer32" , true ) ;
// And delete the CodeBase key, again not throwing if missing
regKey.DeleteSubKey ( "CodeBase" , false ) ;
// Finally close the main key
regKey.Close ( ) ;
}
My html looks like this...
pls give me a solution..
Thanks,
yusuf
Answers
Know the answer? Post it. Somebody with the same question will find it here.