Click here to Skip to main content
15,881,172 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF Design-Time Headaches Pin
GenJerDan11-Feb-14 5:20
GenJerDan11-Feb-14 5:20 
QuestionHitTest Problem Pin
Kevin Marois10-Feb-14 8:18
professionalKevin Marois10-Feb-14 8:18 
AnswerRe: HitTest Problem Pin
Jason Gleim10-Feb-14 9:41
professionalJason Gleim10-Feb-14 9:41 
QuestionLinq-To-SQL DBML Designer Question Pin
Kevin Marois10-Feb-14 7:11
professionalKevin Marois10-Feb-14 7:11 
QuestionMVVM Bound Radio Button Unexpected Behavior Pin
eddieangel7-Feb-14 12:08
eddieangel7-Feb-14 12:08 
AnswerRe: MVVM Bound Radio Button Unexpected Behavior Pin
Richard Deeming10-Feb-14 2:10
mveRichard Deeming10-Feb-14 2:10 
QuestionHow to get entire column values of a datagrid when datagrid column header check box is checked and bind those values to a datatable? Pin
abhinav12235-Feb-14 18:28
abhinav12235-Feb-14 18:28 
QuestionHwndHost & C++/CLI problem Pin
Super Lloyd4-Feb-14 3:09
Super Lloyd4-Feb-14 3:09 
I'm creating an HwndHost subclass in C++/CLI to render DirectX contents.
I got it working but...

When I debug and select win32 and native check I often get this exception when I exit my sample app:
First-chance exception at 0x75212EEC (KernelBase.dll) in WRLDesktop.exe: 0x0000071A: The remote procedure call was canceled, or if a call time-out was specified, the call timed out.

If there is a handler for this exception, the program may be safely continued.


When I look at the (external) call stack I get that:
wtsapi32.dll!56eb210f() Unknown
WindowsBase.ni.dll!5cf134c8()   Unknown
[Managed to Native Transition]
PresentationCore.dll!System.Windows.Interop.HwndTarget.Dispose()    Unknown
PresentationCore.dll!System.Windows.Interop.HwndSource.Dispose(bool disposing)  Unknown
PresentationCore.dll!System.Windows.Interop.HwndSource.OnHwndDisposed(object sender, System.EventArgs args) Unknown
WindowsBase.dll!MS.Win32.HwndWrapper.Dispose(bool disposing, bool isHwndBeingDestroyed) Unknown
WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)  Unknown
WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler) Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs)   Unknown
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam)  Unknown
[Native to Managed Transition]
user32.dll!74cf7694()   Unknown
user32.dll!74cf95ab()   Unknown


So, it seems there is an HwndTarget that is deleted when it shouldn't, or deleted twice, I dunno...

What could be wrong?

My implementation is like the few sample on the web, along those lines:
C++
public ref class D2DHost : public HwndHost
{
private:
	HWND mWnd;

public:
	D2DHost() {}

protected:
	virtual HandleRef BuildWindowCore(HandleRef hwndParent) override
	{
		HWND parentHwnd = (HWND)hwndParent.Handle.ToPointer();
		mWnd = ::CreateWindowEx(0, "static", NULL,
			WS_CHILD | WS_VISIBLE,
			0, 0, 100, 100,
			parentHwnd,
			NULL,
			(HINSTANCE)GetModuleHandle(NULL),
			NULL);

		if (!mWnd)
			return HandleRef(nullptr, System::IntPtr::Zero);

		return HandleRef(this, IntPtr(mWnd));
	}

	virtual void DestroyWindowCore(HandleRef hwnd) override
	{
		::DestroyWindow(mWnd);
	}
};

My programming get away... The Blog...
DirectX for WinRT/C# since 2013!
Taking over the world since 1371!

QuestionXML Treeview NodeChanged event not triggering on attribute edit Pin
wilx2-Feb-14 22:49
wilx2-Feb-14 22:49 
AnswerRe: XML Treeview NodeChanged event not triggering on attribute edit Pin
wilx2-Feb-14 23:09
wilx2-Feb-14 23:09 
QuestionAnother real newbie question - wiring events to handlers not in the code-behind class Pin
Marc Clifton2-Feb-14 10:57
mvaMarc Clifton2-Feb-14 10:57 
AnswerRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
Pete O'Hanlon2-Feb-14 11:27
mvePete O'Hanlon2-Feb-14 11:27 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
Marc Clifton5-Feb-14 15:09
mvaMarc Clifton5-Feb-14 15:09 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
Pete O'Hanlon5-Feb-14 23:15
mvePete O'Hanlon5-Feb-14 23:15 
AnswerRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
_Maxxx_2-Feb-14 19:19
professional_Maxxx_2-Feb-14 19:19 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
Mycroft Holmes3-Feb-14 3:05
professionalMycroft Holmes3-Feb-14 3:05 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
_Maxxx_3-Feb-14 9:29
professional_Maxxx_3-Feb-14 9:29 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
Marc Clifton5-Feb-14 15:13
mvaMarc Clifton5-Feb-14 15:13 
GeneralRe: Another real newbie question - wiring events to handlers not in the code-behind class Pin
_Maxxx_5-Feb-14 15:26
professional_Maxxx_5-Feb-14 15:26 
QuestionHow do I wire Command to functions not in the view? Pin
Marc Clifton2-Feb-14 10:14
mvaMarc Clifton2-Feb-14 10:14 
QuestionHow to bind a dataset to a WPF richtextbox? Pin
fsunole0329-Jan-14 10:43
fsunole0329-Jan-14 10:43 
AnswerRe: How to bind a dataset to a WPF richtextbox? Pin
Wayne Gaylard30-Jan-14 1:07
professionalWayne Gaylard30-Jan-14 1:07 
QuestionHandling RowEditEnding in a DataGrid according to MVVM pattern Pin
Piotr Z27-Jan-14 23:43
Piotr Z27-Jan-14 23:43 
AnswerRe: Handling RowEditEnding in a DataGrid according to MVVM pattern Pin
Pete O'Hanlon28-Jan-14 0:29
mvePete O'Hanlon28-Jan-14 0:29 
GeneralRe: Handling RowEditEnding in a DataGrid according to MVVM pattern Pin
Piotr Z28-Jan-14 0:51
Piotr Z28-Jan-14 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.