Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Unpackaged.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>Unpackaged</id>
<version>0.0.16</version>
<version>0.0.17</version>
<authors>Alexander Sklar</authors>
<owners>Alexander Sklar</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand Down
10 changes: 5 additions & 5 deletions inc/cppxaml/XamlWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,13 @@ namespace cppxaml {
return (int)msg.wParam;
}

mutable HWND m_hWndXamlIsland{ nullptr };
HWND GetBridgeWindow() const {
static HWND hWndXamlIsland = nullptr;
if (!hWndXamlIsland) {
if (!m_hWndXamlIsland) {
auto interop = m_desktopXamlSource.as<IDesktopWindowXamlSourceNative>();
winrt::check_hresult(interop->get_WindowHandle(&hWndXamlIsland));
winrt::check_hresult(interop->get_WindowHandle(&m_hWndXamlIsland));
}
return hWndXamlIsland;
return m_hWndXamlIsland;
}

LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
Expand All @@ -298,7 +298,7 @@ namespace cppxaml {
auto createStruct = reinterpret_cast<LPCREATESTRUCT>(lParam);

// Parent the DesktopWindowXamlSource object to the current window.
winrt::check_hresult(interop->AttachToWindow(m_hWnd)); // This fails due to access violation!
winrt::check_hresult(interop->AttachToWindow(m_hWnd));

this->m_ui = this->m_getUI(*this);
if (m_controller && m_controller->OnUICreated) {
Expand Down