Problems with deleting stuff (Solved)

Started by
12 comments, last by Zeraan 18 years, 6 months ago
Ok hopefully this will fix it, but I gotta fix this problem first.

I changed from char to string, and removed the array stuff. Now when I try to call this

hr = D3DXCreateTextureFromFileEx(m_d3dDevice, m_Images.TexFileName, 0, 0, 1, 0, D3DFMT_A8R8G8B8,
D3DPOOL_DEFAULT, D3DX_FILTER_NONE, D3DX_FILTER_NONE,
m_Images.ColorKey, NULL, NULL, &m_Images.texture);

I get this error:

error C2664: 'D3DXCreateTextureFromFileExA' : cannot convert parameter 2 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

How to fix this problem?
Advertisement
Ok, the problem still persists. I can't find a solution on how to convert string to char * for the function, any help? I bet this will solve my problems!
hr = D3DXCreateTextureFromFileEx(m_d3dDevice, m_Images.TexFileName.c_str(), 0, 0, 1, 0, D3DFMT_A8R8G8B8,
D3DPOOL_DEFAULT, D3DX_FILTER_NONE, D3DX_FILTER_NONE,
m_Images.ColorKey, NULL, NULL, &m_Images.texture);

C++ bends over backwards to be compatible with C. Why DirectX would do this I don't know, but there you have it. [grin]

Cheers,
Twilight Dragon
{[JohnE, Chief Architect and Senior Programmer, Twilight Dragon Media{[+++{GCC/MinGW}+++{Code::Blocks IDE}+++{wxWidgets Cross-Platform Native UI Framework}+++
Ah thanks so much!

This topic is closed to new replies.

Advertisement