I looks like your DX SDK is to old. At least the June 2010 SDK is missing this function. So you either need to use a newer SDK or implement the interface yourself. Since I just hat to implement this interface a few days ago too this may help you to start:
class CDXInclude : public ID3DInclude
{
public:
CDXInclude(const std::string& baseFile);
HRESULT __stdcall Open(D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName,
LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes);
HRESULT __stdcall Close(LPCVOID pData);
private:
std::string m_baseDir;
std::list<std::unique_ptr<char[]>> m_data;
};
CDXInclude::CDXInclude(const std::string& baseFile)
{
size_t pos = baseFile.rfind('/');
if(pos != std::string::npos)
m_baseDir = baseFile.substr(0, pos) + '/';
}
HRESULT CDXInclude::Open(D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName,
LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes)
{
// Open file
std::ifstream file(m_baseDir + pFileName, std::ios::binary);
if(!file.is_open())
{
*ppData = NULL;
*pBytes = 0;
return S_OK;
}
// Get filesize
file.seekg(0, std::ios::end);
UINT size = static_cast<UINT>(file.tellg());
file.seekg(0, std::ios::beg);
// Create buffer and read file
std::unique_ptr<char[]> data(new char[size]);
file.read(data.get(), size);
*ppData = data.get();
*pBytes = size;
m_data.push_back(std::move(data));
return S_OK;
}
HRESULT CDXInclude::Close(LPCVOID pData)
{
m_data.remove_if(shared_equals_raw(pData));
return S_OK;
}
Note: I'm using some C++11 functions but instead you can use simple pointers if you want.