Alas, not in RC files - to the best of my knowledge, they use the C preprocessor which doesn't have a clue about enumerated types and other language features, and then the resource compiler kicks in and it's not too bright either.
Besides, I have unique identifiers for things already (the filenames). Using raw files or GapiVFS lets you reuse that naming; I'm a fan of bundling resources into DLLs where you can use strings in most places but not in GapiDraw.
It's not a big deal, it's just kinda weird since if a function takes in LPCTSTRs you can use both strings and numeric IDs, but not vice versa. If the system has code like this:
- Code:
void LoadSomeResource( HMODULE hModule, DWORD dwID, LPCTSTR lpType )
{
HRSRC hResInfo = ::FindResource( hModule, MAKEINTRESOURCE(dwID), lpType );
if( hResInfo )
{
...
}
}
Then all I want is for it to also have:
- Code:
void LoadSomeResource( HMODULE hModule, LPCTSTR lpName, LPCTSTR lpType )
{
HRSRC hResInfo = ::FindResource( hModule, lpName, lpType );
if( hResInfo )
{
...
}
}
The former can then become a wrapper:
- Code:
void LoadSomeResource( HMODULE hModule, DWORD dwID, LPCTSTR lpType )
{
::LoadSomeResource( hModule, MAKEINTRESOURCE(dwID), lpType );
}
I'm not blocked on this; obviously I could create my own wrapper that does FindResource/SizeofResource/LoadResource/LockResource itself and then calls CreateSurface( DWORD, BYTE* DWORD ).