I hope to god that this code is in the Irrlicht source that you're trying to modify. If you are trying to modify Irrlicht, you need to be sure to rebuild the library entirely, and you need to be sure that you don't have old versions of the Irrlicht.dll floating around.
Yea of course, I put it in draw2DImage for the Burnings software driver.
I have done it differently, but when I tried that it kept crashing.
I don't need to rebuild the library or worry about the dll, because I included the source code in my game engine so I can also debug irrlicht functions.
So I am not using the dll, but the source code directly.
It helps me test.
I think you have to give more information explaining the problem that you are seeing.
If this code is not in the Irrlicht library because you've copied the headers/source of the Irrlicht library into your application, you're asking for trouble. Be sure that you don't duplicate names of classes in the Irrlicht library.