i'm new with this thing named interface and DirectX. I'm hooking a DirectX Interface from a certai开发者_JAVA百科n game and i'm using the DirectX to Draw My Own stuff,like textures and Fonts. My problem are that: When the program call the Hooked Reset Function of the Device,i need to clear all my things from the memory,the Com Interfaces.If i not clear,after the Reset event are called,the Game just try to create a new surface calling d3dDierctx9Create but its fail and just make a error and close the game.
I think that i just need to clear all the things before the Reset Event,its is explained on Msdn.
You don't free an interface. It's reference-counted and managed by the compiler. Let it go out of scope, assign a different interface to the variable, or assign nil to it, and the compiler will generate a call to its _Release
method automatically so it can clean itself up when its reference count drops to 0.
精彩评论