Archived

This topic is now archived and is closed to further replies.

AliasNotFound

DirectX + MFC problem

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites