D3DXCreateTextureFromFileInMemory access violation (c++)
  Home FAQ Contact Sign in
microsoft.public.win32.programmer.directx.graphics only
 
Advanced search
POPULAR GROUPS

more...

microsoft ... graphics Profile…
 Up
D3DXCreateTextureFromFileInMemory access violation (c++)         


Author: Dime Bar
Date: Jun 16, 2008 01:59

-- c++ code snippet --
LPDIRECT3DTEXTURE9 g_textures_;

void somefunc() {

if (g_textures_) {
(g_textures_)->Release();
(g_textures_)=NULL;
}

HRESULT dxt;

dxt = D3DXCreateTextureFromFileInMemory(g_d3dDevice_,
data,
size,
g_textures_);
if (dxt == D3D_OK) {
std::cout << "all ok" << std::endl;
} else {
std::cout << "error" << std::endl;
}
}
--- c++ code snippet --
Show full article (0.83Kb)
3 Comments
Re: D3DXCreateTextureFromFileInMemory access violation (c++)         


Author: Chuck Walbourn [MSFT]
Date: Jun 16, 2008 12:40

Have you checked to see if you are running out of Virtual Address space?

Try setting up your system to use Microsoft Symbol Server and you should get
a lot of detail in your call stack when you crash.

http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx

--
Chuck Walbourn
SDE, XNA Developer Connection

This posting is provided "AS IS" with no warranties, and confers no rights.
no comments
Re: D3DXCreateTextureFromFileInMemory access violation (c++)         


Date: Jun 17, 2008 19:53

[Please do not mail me a copy of your followup]

Dime Bar dimebar.f2s.com> spake the secret code
pipex.net> thusly:
>I have a program which calls somefunc() for every picture that I have.
>It waits some amount of time before calling somefunc again. At some
>point it crashes with access violation when it is doing
>D3DXCreateTextureFromFileInMemory.
>
>Any ideas on how to catch this error so it does not crash ? What should
>I be doing so that it does not cause an access violation ? g_textures_ =
>new(LPDIRECT3DTEXTURE9) ?

In addition to what Chuck said, have you:

- linked with the debug D3DX? (d3dx9d.lib)
- validated that all inputs to the function are correct? (data, size)
- checked for relevant messages in the debug output?
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://www.xmission.com/~legalize/book/download/index.html>

Legalize Adulthood! <http://blogs.xmission.com/legalize/>
no comments
Re: D3DXCreateTextureFromFileInMemory access violation (c++)         


Author: Dime Bar
Date: Jun 18, 2008 00:50

Hiya,

I will try what Chuck has requested - But as i am using 3rd party lib
files I can not compile my program in debug mode so I can not link using
debug libs :(

Cheers,

Ill let you know how I get on :)

Richard [Microsoft Direct3D MVP] wrote:
> [Please do not mail me a copy of your followup]
>
> Dime Bardimebar.f2s.com> spake the secret code
> pipex.net> thusly...
Show full article (1.07Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
Re: Access XP can create Access 2000 MDE ?microsoft.public.access ·
How do I 'back migrate' an Access database from Access 2007 to 200microsoft.public.access ·