You said that the pointer is LPDIRECTDRAW. Are you sure that''s the one you''re using? That is DDraw3, or some old version. Make sure your pointers match whatever interfaces you''re really using. If you get a IDirectDraw4 interface, you have to save it off into a LPDIRECTDRAW4 pointer.
Rock
Access Violation Problem
Lets see...
Kylotan: The debug info appears when the slider is all the way up, and you run the program in the debugger I guess.. I'm using MM debugging. (not monochrome, two SVGA cards)
Cyberdrek: if I change it to LPDIRECTDRAW* dDraw I get a compiler error:
error C2040: 'dDraw' : 'struct IDirectDraw ** ' differs in levels of indirection from 'struct IDirectDraw *'
And I'm not sure if the LPDIRECTDRAW vs LPDIRECTDRAW4 could be a problem. Even if LPDIRECTDRAW isn't the most current, it still calls its own functions right? I'm pretty sure COM is organized so old versions of interfaces will still work...
Oh, and I tried to set them to NULL after releasing them. Still happening.
I mean, what's the real problem with just leaving it there?
Edited by - Qoy on 4/19/00 1:25:41 PM
Kylotan: The debug info appears when the slider is all the way up, and you run the program in the debugger I guess.. I'm using MM debugging. (not monochrome, two SVGA cards)
Cyberdrek: if I change it to LPDIRECTDRAW* dDraw I get a compiler error:
error C2040: 'dDraw' : 'struct IDirectDraw ** ' differs in levels of indirection from 'struct IDirectDraw *'
And I'm not sure if the LPDIRECTDRAW vs LPDIRECTDRAW4 could be a problem. Even if LPDIRECTDRAW isn't the most current, it still calls its own functions right? I'm pretty sure COM is organized so old versions of interfaces will still work...
Oh, and I tried to set them to NULL after releasing them. Still happening.
I mean, what's the real problem with just leaving it there?
Edited by - Qoy on 4/19/00 1:25:41 PM
BREAKTHROUGH!
OK, I now know that the Access Violation ONLY occurs when I run the game on my second monitor... And it''s only gonna be run that way on my computer, so it doesn''t really matter all that much. I still wanna fix it if I can though.
All I have to do to set up the second monitor is enumerate devices, and in a callback function I test and return the GUID of the first device which has a monitor handle of NULL (because that''s the first display device attached to the main display, but not the main display). Then I use that GUID to set up DirectDraw.
Do I need to do something to return the GUID or something?
Thanks!
OK, I now know that the Access Violation ONLY occurs when I run the game on my second monitor... And it''s only gonna be run that way on my computer, so it doesn''t really matter all that much. I still wanna fix it if I can though.
All I have to do to set up the second monitor is enumerate devices, and in a callback function I test and return the GUID of the first device which has a monitor handle of NULL (because that''s the first display device attached to the main display, but not the main display). Then I use that GUID to set up DirectDraw.
Do I need to do something to return the GUID or something?
Thanks!
Ok, I turned the debug info back up (I think installing DX7 turned the slider back to ''less'') and, what do you know, I don''t get First-Chance exceptions anymore... making me think it wasn''t my code in the first place. Hmm...
There is a big difference between LPDIRECTDRAW and LPDIRECTDRAW4. Old versions of the interface are guarenteed to work IF you use the old interfaces from start to finish. So if your program creates a IDirectDraw interface, and saves it in a LPDIRECTDRAW variable, it will continue to work even on DX7. The interface will always be there. That''s why DX3 games run fine under DX5,6,7,.....
But you can''t (possbly read shouldn''t) create a IDirectDraw4 interface and treat it as a IDirectDraw interface. It isn''t one. Some functions may line up correctly, but under no circumstance should you rely on that.
I''m not a COM wheenie (nor do I want to be), so maybe someone can elaborate, but you have to keep your pointers correctly typed. It''s pretty easy; just make sure if you''re creating a IDirectDraw4 interface, to change your pointer type to LPDIRECTDRAW4. Same goes for the surface interfaces, and any others.
Rock
But you can''t (possbly read shouldn''t) create a IDirectDraw4 interface and treat it as a IDirectDraw interface. It isn''t one. Some functions may line up correctly, but under no circumstance should you rely on that.
I''m not a COM wheenie (nor do I want to be), so maybe someone can elaborate, but you have to keep your pointers correctly typed. It''s pretty easy; just make sure if you''re creating a IDirectDraw4 interface, to change your pointer type to LPDIRECTDRAW4. Same goes for the surface interfaces, and any others.
Rock
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement