Quote Originally Posted by ijcro
Is initialization and finalization surface correct?
sorry I am a very beginner in this area , so I am not sure what you mean by
that.

If you follow the example I did show it will come up with acess violation.
If I understand your question so yes it do work from beginning , I can draw on the surface , but if I do a resize , it make an access violation.

It do works nicely from beginning - I can draw on the surface without problem, until I do a resize .

the contents of ddraw change a lot after the resize, example the
Idirectdraw pointers is set to nil

Contents of : dxdraw1.DDraw

Before resize :
(0, Pointer($14A390) as IDirectDraw, Pointer($14AD00) as IDirectDraw4, Pointer($14A360) as IDirectDraw7, (380, 2487385025, 4914808, 238353, 670651424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 660570048, 648773568, 1, 0, 21, 0, 0, 0, 0, 0, (0, 0, 0, 0, 0, 0, 4096, 0), (809661180), 32, 512000, 32, 16000, 32, 16000, 0, 0, 0, 2147483712, 0, 0, (0, 0, 0, 0, 0, 0, 0, 0), 2147483712, 0, 0, (0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, (0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 2048, 2420245441, 0, 513, 87072, (1, 0, 0, 0, 0, 0, 4096, 214748364, (809661180, 512, 0, 0)), (380, 4106256961, 1, 512, 261347, 0, 839, 0, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (1, 0, 0, 0, 0, 0, 4096, 214748364, (4330320), 0, 0, 0, 0, 0, 0, 0, 0, 0, 4106256961, 512, 261347, (1, 0, 0, 0, 0, 0, 4096, 214748364, 4106256961, 512, 261347, (1, 0, 0, 0, 0, 0, 4096, 214748364, 4106256961, 512, 261347, (1, 0, 0, 0, 0, 0, 4096, 214748364, 0, 0, 0, 4106256961, 1, 512, 261347, (1, 0, 0, 0, 0, 0, 4096, 214748364, (4330320, 512, 0, 0)), $964D18, $964D2C, $964D40)


After resize :
(856, nil, nil, nil, (380, 2487385025, 4914808, 238353, 670651424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 660570048, 648773568, 1, 0, 21, 0, 0, 0, 0, 0, (0, 0, 0, 0, 0, 0, 4096, 0), (809661180), 32, 512000, 32, 16000, 32, 16000, 0, 0, 0, 2147483712, 0, 0, (0, 0, 0, 0, 0, 0, 0, 0), 2147483712, 0, 0, (0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, (0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 2048, 2420245441, 0, 513, 87072, (1, 0, 0, 0, 0, 0, 4096, 214748364, (809661180, 512, 0, 0)), (380, 4106256961, 1, 512, 261347, 0, 839, 0, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (1, 0, 0, 0, 0, 0, 4096, 214748364, (4330320), 0, 0, 0, 0, 0, 0, 0, 0, 0, 4106256961, 512, 261347, (1, 0, 0, 0, 0, 0, 4096, 214748364, 4106256961, 512, 261347, (1, 0, 0, 0, 0, 0, 4096, 214748364, 4106256961, 512, 261347, (1, 0, 0, 0, 0, 0, 4096, 214748364, 0, 0, 0, 4106256961, 1, 512, 261347, (1, 0, 0, 0, 0, 0, 4096, 214748364, (4330320, 512, 0, 0)), $964D18, $964D2C, $964D40)

Best regards
Kim Pedersen