MCPcopy Create free account
hub / github.com/MicrosoftEdge/WebView2Samples / GetLocalPath

Method GetLocalPath

SampleApps/WebView2APISample/AppWindow.cpp:2854–2869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2852}
2853
2854std::wstring AppWindow::GetLocalPath(std::wstring relativePath, bool keep_exe_path)
2855{
2856 WCHAR rawPath[MAX_PATH];
2857 GetModuleFileNameW(g_hInstance, rawPath, MAX_PATH);
2858 std::wstring path(rawPath);
2859 if (keep_exe_path)
2860 {
2861 path.append(relativePath);
2862 }
2863 else
2864 {
2865 std::size_t index = path.find_last_of(L"\\") + 1;
2866 path.replace(index, path.length(), relativePath);
2867 }
2868 return path;
2869}
2870
2871std::wstring AppWindow::GetLocalUri(
2872 std::wstring relativePath, bool useVirtualHostName /*= true*/)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected