Original Post
I'm trying to construct mappings for string to technique IDs for my renderer, but it looks like FindNextValidTechnique is not operating correctly. It's probably something somewhere else in my program, but I want to know if I'm doing this bit right before I go hunting. I get an error when I try to construct the string from the handle, because the handle is an invalid pointer. D3DXHANDLEs are just LPCSTRs, so this should work if the pointer's valid. The thing is, FindNextValidTechnique fills NextHandle with an invalid pointer. pEffect points to a valid effect.
// Construct technique mappings
int EffectID = (int)m_Effects.size() - 1;
D3DXHANDLE CurrentHandle = NULL;
D3DXHANDLE NextHandle = NULL;
do
{
pEffect->FindNextValidTechnique(CurrentHandle, &NextHandle);
if(NextHandle != NULL)
{
CTechniqueInfo TechniqueInfo;
TechniqueInfo.m_hTechniqueHandle = NextHandle;
TechniqueInfo.m_nEffectIndex = EffectID;
m_TechniqueNameMap[string(NextHandle)] = m_nTechniqueCounter; // Error here
m_TechniqueInfo[m_nTechniqueCounter] = TechniqueInfo;
++m_nTechniqueCounter;
}
} while (NextHandle != NULL);