diff --git a/src/celestia/win32/winmain.cpp b/src/celestia/win32/winmain.cpp index a84741f57..c78e2a7ff 100644 --- a/src/celestia/win32/winmain.cpp +++ b/src/celestia/win32/winmain.cpp @@ -3059,12 +3059,12 @@ int APIENTRY WinMain(HINSTANCE hInstance, // URL on the command line, send the URL to the running instance // of Celestia before terminating. auto startURL = appCore->getStartURL(); - if (!startURL().empty()) + if (!startURL.empty()) { COPYDATASTRUCT cd; cd.dwData = 0; cd.cbData = startURL.length(); - cd.lpData = reinterpret_cast(const_cast(startURL.c_str())); + cd.lpData = reinterpret_cast(const_cast(startURL.data())); SendMessage(existingWnd, WM_COPYDATA, 0, reinterpret_cast(&cd)); } SetForegroundWindow(existingWnd);