SteamRE / open-steamworks

Open Steamworks is a set of reverse engineered headers for the Valve's Steam Client. More or less abandoned now that the Steamworks SDK is publically available.
252 stars 86 forks source link

Win32 Problems #21

Closed Salads closed 8 years ago

Salads commented 8 years ago

In SteamTypes.h line 66, i see a #undef SendMessage // for ISteamGameCoordinator001 to work right..

Because of this I can't really do much with common win32 controls that use messages to initialize themselves. Can you wrap SendMessage in a namespace or something instead?

Netshroud commented 8 years ago

ISteamGameCoordinator and full usage of windows.h are mutually exclusive because Microsoft alias SendMessage to either SendMessageA or SendMessageW. This same issue crops up in the official Steamworks SDK, IIRC, and any other library / project / code that contains a function, variable, etc. named SendMessage.

Wrapping SendMessage in a namespace wouldn't work with the active #define anyway, as far as I know. Instead of ::ISteamGameCoordinator001::SendMessage< A | W > it would be SomeNamespace::ISteamGameCoordinator001::SendMessage< A | W >, which does not solve the problem.

The simplest solution is to use proper separation of concerns. Have one cpp file contains the code dealing with controls and another file contains the code dealing with steamworks.