Simple code:
ATOM atom = GlobalAddAtom(L"TestCpp1");
It returns 0 and GetLastError returns 0x5 (Access Denied). Nothing on MSDN about it. This is on Win7. Admin rights make no difference.
Same code works on XP. AddAtom (local) works on Win7.
What's causing this?
Is this a GUI or Console application? One thing you might try is to explicity call LoadLibrary("User32") before calling GlobalAddAtom.
Here is a reference to someone that had a similar problem, on XP maybe this is relevant? http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.kernel/2004-03/0851.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With