Add small wxOleInitializer RAII helper.

Wrap wxOleInitialize()/wxOleUninitialize() in a helper class ensuring that we
never forget to call the latter.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Ensure OLE is initialized in wxFileName::GetShortcutTarget().

If it isn't, the function doesn't risk to work. This is especially pernicious
because OLE is initialized on startup in GUI applications, but not in the
console ones only using wxBase, so this function can, completely unexpectedly,
give different results in them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't change a shortcut file name when changing its path.

wxFileName::MakeRelativeTo() is only supposed to change the path of the file,
not its name, but it was doing the latter for the shortcuts as it implicitly
resolved them to the name of their target.

Fix this by ensuring we do not use wxPATH_NORM_SHORTCUT in MakeRelativeTo().

Closes #16239.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxCOMPtr<> in wxFileName instead of manual Release() calls.

Make the code shorter and safer.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77510 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add wxPowerResourceBlocker for power management.

Add functions to acquire/release power resources, preventing/allowing back the
system to go to sleep or turn off the screen and a class wrapping them in a
safe way.

This patch implements the functions for MSW and OSX, adds documentation and
updates the sample to demonstrate the new functionality.

Closes #16413.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775