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

TargetInvocationException

5 Answers 245 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
James Atherton
Top achievements
Rank 1
James Atherton asked on 03 Sep 2009, 08:40 PM

I am currently running Telerik WinControls 2009 Q2, I have a ribbon on an MDI form inheriting from the ShapeForm form class.

I would click run, it comes up without a hitch, sometimes it will be fine, most times however if I move the mouse, hover over a button, do nothing, it will throw a TargetInvocationException.  This exception is pasted below.  This application worked flawlessly till I added the RibbonControl to update the GUI.

Any suggestions on fixing this issue would be greatly appreciated.  I am at a loss as to what might be going on but the common denominator seems to be the ribbon   The inner exception is a null reference exception in Telerik.WinControls but I am at a loss what this might be.

 

 

Exception:

System.Reflection.TargetInvocationException was unhandled

  Message="Exception has been thrown by the target of an invocation."

  Source="mscorlib"

  StackTrace:

       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

       at System.Delegate.DynamicInvokeImpl(Object[] args)

       at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)

       at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)

       at System.Threading.ExecutionContext.runTryCode(Object userData)

       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

       at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)

       at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

       at System.Windows.Forms.Control.WndProc(Message& m)

       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

       at Telerik.WinControls.RadControl.WndProc(Message& m)

       at Telerik.WinControls.UI.RadRibbonBar.WndProc(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

       at System.Windows.Forms.Application.Run(ApplicationContext context)

       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)

       at SoftwareConfigurator.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81

  InnerException: System.NullReferenceException

       Message="Object reference not set to an instance of an object."

       Source="Telerik.WinControls"

       StackTrace:

            at Telerik.WinControls.Layouts.ContextLayoutManager.LayoutQueue.GetTopMost()

            at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()

            at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager)

       InnerException:

5 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 04 Sep 2009, 08:17 AM
Hi James,

Thanks for writing and for reporting this issue. We are going to take a look at it but I would still like to receive some more details on the inner exception in particular. These details might be helpful to exactly determine the reason for the undesired behavior. Thanks for your time. I look forward to receiving the requested details.

Regards,
Deyan
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
James Atherton
Top achievements
Rank 1
answered on 04 Sep 2009, 01:49 PM
InnerException: {"Object reference not set to an instance of an object."}
Source: "Telerik.WinControls"
StackTrace:    at Telerik.WinControls.Layouts.ContextLayoutManager.LayoutQueue.GetTopMost()
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager)
TargetSite: {Telerik.WinControls.RadElement GetTopMost()}

If there is any additional information I might be able to provide relating to this error let me know.
0
Deyan
Telerik team
answered on 09 Sep 2009, 06:12 PM
Hello James,

Thanks for the details.

However, we are still not able to reproduce this issue. I would also like to mention that the RadRibbonBar control is generally meant to be used in TopLevel forms due to its UI concept: to expose the functionality of an application in one place. It is supposed to replace the old-fashioned menus and toolbars, which are also TopLevel application controls.

We are going to further investigate the null-reference exception though and hopefully we will fix it for our next major release.

Thanks for pointing this issue to us.

 
Sincerely yours,
Deyan
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
Marcello
Top achievements
Rank 1
answered on 13 Jan 2016, 03:52 PM

Hello, 

we have the same problem on 2015Q1 but we don't have a RibbonControl but a RadGridView

 System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.Layouts.ContextLayoutManager.LayoutQueue.GetTopMost()
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()

Have you some suggestion on how to prevent this error?

 

Kind regards

Marcello

 

0
Dimitar
Telerik team
answered on 15 Jan 2016, 04:04 PM
Hi Marcello, 

Thank you for writing.

The provided information is not sufficient for us to determine why this exception occurs. This is why I would recommend you to submit a support ticket for this. Please include as much information as possible so that our technical team can take a deep dive into the issue and come up with a solution for you.

I hope this will be useful. 

Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
RibbonBar
Asked by
James Atherton
Top achievements
Rank 1
Answers by
Deyan
Telerik team
James Atherton
Top achievements
Rank 1
Marcello
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or