January 17th, 2000, 11:11 AM
I have tried initializing DirectDraw with the following code :
private DirectX as DirectX7
private DirectDraw as DirectDraw7
private SurfaceDesc as DDSURFACEDESC2
private PrimarySurface as DirectDrawSurface7
private BackBuffer as DirectDrawSurface7
private Sub Main()
set DirectX = new DirectX7
set DirectDraw = DirectX.DirectDrawCreate("")
'error 1 :
DirectDraw.SetCooperativeLevel 0, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE
DirectDraw.SetDisplayMode 1024, 768, 16, 0, DDSDM_DEFAULT
With SurfaceDesc
.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT
.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Or DDSCAPS_COMPLEX Or DDSCAPS_FLIP
.lBackBufferCount = 1
End With
'error 2 :
set PrimarySurface = DirectDraw.CreateSurface(SurfaceDesc)
SurfaceDesc.ddsCaps.lCaps = DDSCAPS_BACKBUFFER
set BackBuffer = PrimarySurface.GetAttachedSurface(SurfaceDesc.ddsCaps)
set PrimarySurface = nothing
set DirectDraw = nothing
set DirectX = nothing
End Sub
When running it, the line just after "ERROR1" causes an "Invalid procedure call or argument" error.
The error does not occur only when I change the flag argument to DDSCL_NORMAL.
This, expectedly, causes an automation error (2005532447 - DDERR_NOEXCLUSIVEMODE ) in the line after "ERROR2".
Any help would be highly appreciated,
Gino
private DirectX as DirectX7
private DirectDraw as DirectDraw7
private SurfaceDesc as DDSURFACEDESC2
private PrimarySurface as DirectDrawSurface7
private BackBuffer as DirectDrawSurface7
private Sub Main()
set DirectX = new DirectX7
set DirectDraw = DirectX.DirectDrawCreate("")
'error 1 :
DirectDraw.SetCooperativeLevel 0, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE
DirectDraw.SetDisplayMode 1024, 768, 16, 0, DDSDM_DEFAULT
With SurfaceDesc
.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT
.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Or DDSCAPS_COMPLEX Or DDSCAPS_FLIP
.lBackBufferCount = 1
End With
'error 2 :
set PrimarySurface = DirectDraw.CreateSurface(SurfaceDesc)
SurfaceDesc.ddsCaps.lCaps = DDSCAPS_BACKBUFFER
set BackBuffer = PrimarySurface.GetAttachedSurface(SurfaceDesc.ddsCaps)
set PrimarySurface = nothing
set DirectDraw = nothing
set DirectX = nothing
End Sub
When running it, the line just after "ERROR1" causes an "Invalid procedure call or argument" error.
The error does not occur only when I change the flag argument to DDSCL_NORMAL.
This, expectedly, causes an automation error (2005532447 - DDERR_NOEXCLUSIVEMODE ) in the line after "ERROR2".
Any help would be highly appreciated,
Gino