DD7: No exclusive mode error on initialization

Started by
-1 comments, last by digital_phantom 17 years, 11 months ago
For demonstration purposes I'm using the old DirectDraw7 interface in VB6 to show off a simple tile engine, but there is a problem occurring. Right in the beginning when initializing DirectDraw for windowed mode sometimes everything works but after a few runs an error eventually starts to popup, the error is DDERR_NOEXCLUSIVEMODE... this happens as follows... First DirectDraw is initialized for windowed mode using: Call DirectDraw.SetCooperativeLevel(WindowHandle, DDSCL_NORMAL) And then anything after it causes an error, in my code the next thing I do is Call DirectDraw.RestoreDisplayMode() just in case of changing to full screen or to windowed, but even if that was skipped to the next skip of creating the primary surface: Dim ddSD As DDSURFACEDESC2 ddSD.lFlags = DDSD_CAPS ddSD.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Set DDPrimarySurface = DirectDraw.CreateSurface(ddSD) Then the NOEXCLUSIVEMODE error raises, now I've been playing around and back to the DirectDraw.SetCooperativeLevel line, if I changed it to Call DirectDraw.SetCooperativeLevel(WindowHandle, DDSCL_NORMAL or DDSCL_EXCLUSIVEMODE) which won't work because it only works in fullscreen but it causes the error like the following lines would do and then when I change it back to just the DDSCL_NORMAL flag while still in run-time mode, then it runs. The only way to fix this temporary is to reset the computer, but then it eventually happens again after a few runs. I'm stomped about this, few people have mentioned re-installing DirectX, that I have done, and it works for a little while but then this repeats all over again, I don't think I'm doing anything wrong since it's just the first two lines in my code, but I could be wrong. I've already done searches on this in google and on here and no information has been of help or close to my problem. So any help is very appreciated to get this age old problem out of my head. Thanks in advance.

This topic is closed to new replies.

Advertisement