Archived

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

Prairie

quick MFC/DirectX Question

Recommended Posts

I have a class derived from a view class. With-in the OnCreate() handler I call my initialization for directx. This fails to create the device, and I realize that it''s due to the window not being created (if I call the function on a mouse click (after the view is created) it works like a charm). My question is, how do I get around this? Where should I call my Init function? Thanks in advance. Prairie

Share this post


Link to post
Share on other sites
Try yout InitInstance() function. You''re actually suppoised to put intialization code in there. Instantiating DirectX during OnCreate() is analogous to creating the device in response to a WM_CREATE message - a general no-no.

Share this post


Link to post
Share on other sites