Open eugenesvk opened 3 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
It looks basically good but I'll need the cla/google signed before I can accept the patch.
@googlebot I signed it!
I get four instances of this error when compiling:
1>C:\src\github\UIforETW\UIforETW\Settings.cpp(17,10): fatal error C1853: 'x64\Release\UIforETW_devrel.pch' precompiled header file is from a different version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)
I don't mind switching to C++17 but I don't think that global constructors are a great idea. How about:
int GetAreYouMeId() { static const UINT uwmAreYouMe = RegisterWindowMessage(L"678fd291e05741edb987c0a4f5650866"); return uwmAreYouMe; }
Then it gets constructed on first use instead of before WinMain
The return type in my sample function should be UINT.
I noticed this was still open and decided to see why. Part of the reason is that I pasted the wrong error message into my last comment. The actual error message is:
1>C:\src\github\UIforETW\UIforETW\UIforETW.h(46,19): error C7525: inline variables require at least '/std:c++17' (compiling source file Settings.cpp)
That message happens on this line:
inline const UINT uwmAreYouMe = RegisterWindowMessage(L"678fd291e05741edb987c0a4f5650866");
I continue to think that that isn't a great idea. Inline data is great. Global constructors that run before main are not.
Old FindWindow() function could mistake an Explorer folder 'UI for ETW' for another instance of 'UI for ETW' (since window title is identical) New custom function registers a unique window message that allows to uniquely identify another instance of 'UI for ETW' Bonus: restore the minimized window of 'UI for ETW'
Resolves: #147