Sign in to follow this  
Hana Lee

weired situation between Direct3D9 and OCX.

Recommended Posts



I experienced strange things..


is there some problem with compatibility between OCX and DirectX or VB6?


I only created Device (LPDIRECT3DDEVICE9) with IDirect3D9::CreateDevice() in OCX code.


and then I added this ocx Control to my application made in VB6.


but some reason, return value of Now function was incorrect after CreateDevice() called.


and there is another situation with Delphi.


i added ocx Control to my application made in Delphi6. but the value of devision was strange too.


for example ,

when i calcurate 4/2 ,

result value is  2 without CreateDevice(), but 1.99999.. after CreateDevice() called.


is there any idea?


DirectX SDK version is 2010JUNE.

is there some problem with compatibility between OCX and DirectX or VB6?

do i need to downgrade directX SDK? like DirectX 9.0b.. or lower. Or source code has a problem?



 m_d3dpp.BackBufferWidth            = 100;
 m_d3dpp.BackBufferHeight           = 100;
 m_d3dpp.BackBufferFormat           = D3DFMT_X8R8G8B8;
 m_d3dpp.BackBufferCount            = 1;
 m_d3dpp.MultiSampleType            = D3DMULTISAMPLE_NONE;
 m_d3dpp.MultiSampleQuality         = 0;
 m_d3dpp.SwapEffect                 = D3DSWAPEFFECT_COPY;
 m_d3dpp.hDeviceWindow              = m_hwnd;
 m_d3dpp.Windowed                   = m_bWindowed;
 m_d3dpp.Flags                      = 0;
 m_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
  m_d3dpp.PresentationInterval   = D3DPRESENT_INTERVAL_IMMEDIATE;




Thank you.

Edited by SunkistOrange

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this