.net - Performance issue when resizing Win32 containing WPF -


i in process of migrating existing legacy project. want use c++/cli bridge between business logic (native c++) , interface (wpf). followed msdn article on how host wpf content in win32 window starting point. however, cannot wrap head around problem: whenever resize host window...

  • there serious delays , window repainting slowly.
  • it causes desktop window manager (dwm.exe) increase dramatically in memory usage (2 gb in few seconds of resizing)

i stripped down code bare minimum. simple, red wpf page , normal win32 project little changes:

namespace managedcode {     using namespace system;     using namespace system::windows::interop;      void create(hwnd parent) {         hwndsource^ container = gcnew hwndsource(null, ws_child | ws_visible, null,             0, 0, 100, 100, "wpfcontent", intptr(parent));         managed::wpfpage^ page = gcnew managed::wpfpage();         container->rootvisual = page;     } }  lresult callback wndproc(hwnd hwnd, uint message, wparam wparam, lparam lparam) { ...     case wm_create:         managedcode::create(hwnd); ... } 

this has stupid.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -