Skip to content

Commit 3427a46

Browse files
authored
Move projects to use latest WebView2 SDK 1.0.1010-prerelease (#103)
* Updates for Win32, WPF and WinForms sample apps for 1.0.1010-prerelease * Move projects to use WebView2 SDK 1.0.1010-prerelease
1 parent fa44c46 commit 3427a46

33 files changed

+1412
-233
lines changed

SampleApps/WebView2APISample/App.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,22 @@ static int RunMessagePump()
174174
}
175175

176176
// Make a new thread.
177-
void CreateNewThread(UINT creationModeId)
177+
void CreateNewThread(AppWindow* app)
178178
{
179179
DWORD threadId;
180+
app->AddRef();
180181
HANDLE thread = CreateThread(
181-
nullptr, 0, ThreadProc, reinterpret_cast<LPVOID>(uintptr_t(creationModeId)),
182+
nullptr, 0, ThreadProc, reinterpret_cast<LPVOID>(app),
182183
STACK_SIZE_PARAM_IS_A_RESERVATION, &threadId);
183184
s_threads.insert(std::pair<DWORD, HANDLE>(threadId, thread));
184185
}
185186

186187
// This function is the starting point for new threads. It will open a new app window.
187188
static DWORD WINAPI ThreadProc(void* pvParam)
188189
{
189-
new AppWindow(static_cast<UINT>(reinterpret_cast<intptr_t>(pvParam)));
190+
AppWindow* app = static_cast<AppWindow*>(pvParam);
191+
new AppWindow(app->GetCreationModeId());
192+
app->Release();
190193
return RunMessagePump();
191194
}
192195

SampleApps/WebView2APISample/App.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
extern HINSTANCE g_hInstance;
99
extern int g_nCmdShow;
1010
extern bool g_autoTabHandle;
11-
void CreateNewThread(UINT creationModeId);
11+
class AppWindow;
12+
void CreateNewThread(AppWindow* app);

0 commit comments

Comments
 (0)