views:

33

answers:

1

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?

+1  A: 

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

Chris Taylor
No freakin' way... I did see this message but I couldn't figure out what the man was saying - thanks for decoding it for me, it works like this.
everwicked