Skip to main content
gamedev.net
🔒 Locked

DirectX + MFC problem

Started by AliasNotFound Aug 13, 2001 at 9:20 PM 1 replies 400+ views
Original Post
AliasNotFound
AliasNotFound
I created a basic DirectX class that sets up a Directx object and creates a primary and secondary buffer and then used it in a basic MFC app. When I tried to lock the primary surface on the OnPaint event of the main window I get an Access Violation error (C000005). I''m sure there is a strong possiblity that I am doing something wrong but i''m just not sure what. The class works fine when I use it in a plain WIN32 app. Oh, and I forgot to mention that it''s full screen exclusive, but since MFC won''t let me use a popup window style, it shows the window. Anyone know what could be causing this Access violation error? Thanks, Phillip
Shannon Barber
Shannon Barber
I''ve haven''t done full-screen with MFC yet, but the MFCFog example does do this, check out that code and see if they do anything special to remove the window border...

It''s hard to say what causes and access violation without seeing the code that''s violating...

Magmai Kai Holmlor
- Not For Rent
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
AliasNotFound
AliasNotFound
I think I figured out part of my problem. When I ran it throught the debugger I noticed that my DirectX object had not been instantiated. Seems I forgot about onPaint being called immediatley after window creation - DOH!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.