c# - Cannot obtain value of local or argument 'hwndSource' as it is not available at this instruction pointer -
I am playing with Interpost and I thought: "O code is something that reaches the clipboard ..." So I googled and found some article (yes I'm doing it with WPF - .NET 3.5). Although the following method triggers an error (seen in the title) and throws a stackoverflow. Private Zero Windows_SourceInitialized (Object Sender, EventArgs E) {// Hook Clipboard Base.OnSourceInitialized (e); HwndSource hwndSource = Presentation Source.frameVisual (this) as HWDSOSR; If (hwndSource! = Null) {installHandle = hwndSource.Handle; Viewer Handle = Setclipboard View (Installed Handle); HwndSource.AddHook (new HwndSourceHook (this.hwndSourceHook)); } // and hook to clipboard} I do not know (actually) what is happening there. Any thoughts? To call your issue, base.OnSourceInitialized is. When you are overriding the method, you should call the base implementation, but this is not the case here: you are handling a method, do not override a method. Since SourceInitialized