This is a migrated thread and some comments may be shown as answers.

Themes throwing exceptions ...

2 Answers 57 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pedro
Top achievements
Rank 1
Pedro asked on 27 Jan 2010, 06:08 PM
Hi, in my local machine all themes work fine, but on some XP and Vista machines the application is throwing errors when I set the global theme like this:
StyleManager.ApplicationTheme = new SummerTheme(); 
in the app.xaml.cs in the start up event.
Any ideas why this is happening?
this is the error:

{System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component. 
  at MS.Internal.XcpImports.CheckHResult(UInt32 hr) 
  at MS.Internal.XcpImports.SetValue(INativeCoreTypeWrapper obj, DependencyProperty property, String s) 
  at MS.Internal.XcpImports.SetValue(INativeCoreTypeWrapper doh, DependencyProperty property, Object obj) 
  at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value) 
  at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle, PropertyInvalidationReason reason) 
  at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value) 
  at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) 
  at System.Windows.ResourceDictionary.set_Source(Uri value) 
  at Telerik.Windows.Controls.Theme.CreateResourceDictionaryForApplicationTheme(Theme theme, String controlAssembly) 
  at Telerik.Windows.Controls.StyleManager.OnApplicationThemeChanged(Theme oldValue, Theme newValue) 
  at Telerik.Windows.Controls.StyleManager.set_ApplicationTheme(Theme value) 
  at Edupoint.Client.ClassBoard.App.Application_Startup(Object sender, StartupEventArgs e) 
  at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) 
  at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)}

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 28 Jan 2010, 04:35 PM
Hello Pedro,

Unfortunately, we were not able to reproduce the error you've encountered.

Please, find the attached file and compare it with your project


Best wishes,
Dimitrina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Pedro
Top achievements
Rank 1
answered on 03 Feb 2010, 04:50 PM
Hi,
I solved the problem, I still does not know why is happening this, but at least I know how to fix it, the problem was the source control client,  when I got the latest version on windows 7 all the references are satisfied properly, but when I download the code from XP or Vista, the references to the theme dlls are not found, this is weird since all the telerik dlls are in the same folder and only the theme's dlls are not found, removing the references and adding again fixes the problem.
What is odd to me, is that the SummerTheme Class is not in the same dll than the theme it self, thats why the code was compiling but throwing exceptions at run time, having the SummerTheme class in the same dll would help with cases like this, but I guess there is a reason for having it separated.


Tags
General Discussions
Asked by
Pedro
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Pedro
Top achievements
Rank 1
Share this question
or