Archived

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

Can I get a pointer to an IDirect3D9 interface by Calling CoCreateInstance ?

This topic is 5017 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I can get a pointer to an IDirectInput8 interface by calling DirectInput8Create or CoCreateInstance, that''s OK. For instance: IDirectInput8* iDInput = NULL; //1: DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&iDInput, NULL); //2: CoCreateInstance(CLSID_DirectInput8, NULL, CLSCTX_INPROC, IID_IDirectInput8, (void**)&iDInput); Just like the 1st method above, I can get a pointer to an IDirect3D9 interface by calling Direct3DCreate9 as the following. IDirect3D9 *iD3D = Direct3DCreate9(D3D_SDK_VERSION); Is there anyway to get a pointer to an IDirect3D9 interface by calling CoCreateInstance ? Thanks.

Share this post


Link to post
Share on other sites
Well, I haven''t done it that way (and wouldn''t) but it ought to work.. DX is based on COM and thus has to follow all the COM rules .. it will be based on IUnknown and thus will expose its interfaces thru QueryInterface, like any COM object.

Share this post


Link to post
Share on other sites