Quote:Original post by jafe
Firstly, since it's pseudocode above, ASSUME I'm smart enough to right procedures to stop this.
Secondly, the SDK mentions that EnumSurfaces returns pointers to all drawable directdraw surfaces.
Thirdly, releasing a COM object used to be standard procedure after it's been intialised to clean up memory when the object is no longer needed.
EDIT: Also, it's not the one surface I want from my process, I'm trying to enumerate all of the directdraw surfaces in use and active on the computer at that time.
1)
write [smile] And if it's psuedocode, that's even less reason to have the cast in there. You'd be surprised how many people just stuff a cast in there for the hell of it.
2) Where exactly does it say that? Exactly what it does depends on the flags you pass it. You're asking it for all the surfaces that
already exist, and you haven't create any surfaces yet. So there's none to return, so the callback is never called, so this is correct behaviour. If you have created some surfaces, please show us the code you use to create them.
3) Yes, but you don't initialise the surface, do you? Like I said, I'm not sure what you're supposed to do here, the SDK docs don't actually say. What I mean is that when this starts working, you should check that you're not leaking memory or using invalid memory by incorrectly Release()ing or not Release()ing the suface.
EDIT: Never mind, it does say that - I just missed it.