Jump to content
  • Advertisement
Sign in to follow this  
andyhansen

DX11 (KernelBase.dll) Microsoft C++ exception: _com_error at memory location 0x0021e7dc..

This topic is 2837 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've been working on porting my DirectX Framework over to DX11. At runtime I've been getting the following type of error:
First-chance exception at 0x75b69617 (KernelBase.dll) in Engine.exe: Microsoft C++ exception: _com_error at memory location 0x0021e7dc..

Multiple of these exceptions are thrown. It occurs when I call: D3D11CreateDeviceAndSwapChain


//Create the swap chain parameters
DXGI_SWAP_CHAIN_DESC sd;
ZeroMemory(&sd,sizeof(sd));
sd.BufferCount=1;
sd.BufferDesc.Width=Engine->GetWindow()->GetWindowWidth();
sd.BufferDesc.Height=Engine->GetWindow()->GetWindowHeight();
sd.BufferDesc.Format=DXGI_FORMAT_R8G8B8A8_UNORM;
sd.BufferDesc.RefreshRate.Numerator=60;
sd.BufferDesc.RefreshRate.Denominator=1;
sd.BufferUsage=DXGI_USAGE_RENDER_TARGET_OUTPUT;
sd.OutputWindow=Engine->GetWindow()->GetHandle();
sd.SampleDesc.Count=1;
sd.SampleDesc.Quality=0;
sd.Windowed=(Engine->GetWindow()->GetWindowMode()==CWindow::WINDOW);
//create the swap chain
UINT flags=0;
D3D_FEATURE_LEVEL fl;
#if defined(DEBUG) || defined(_DEBUG)
flags |= D3D11_CREATE_DEVICE_DEBUG;
#endif
if(FAILED(D3D11CreateDeviceAndSwapChain(NULL,D3D_DRIVER_TYPE_HARDWARE,NULL,0,NULL,NULL,D3D11_SDK_VERSION,&sd,&pSwapChain,&pDevice,&fl,&pImmediateContext))){
Engine->ShowError("Failed to create d3d device.");
return;
}


I'm using VS C++ 2010 professional. I created the project as an empty Win32 project. Does anyone have any ideas? I've been working at this for hours.

Share this post


Link to post
Share on other sites
Advertisement
I don't even know where to look. My program runs properly as far as I know, it just shows those exceptions in the debug output window, so for now I'm just ignoring them. I'm hoping that someone has encountered these errors before and knows what could cause a _com_error.

Share this post


Link to post
Share on other sites
Those errors are in the driver or runtime, and you usually don't need to worry about them. For example I used to get them every time I switched to fullscreen in debug mode, but after a driver update they went away.

Read the following page for some information: http://blogs.msdn.com/b/davidklinems/archive/2005/07/12/438061.aspx

Also, you can break on those exceptions by choosing Exceptions from the Debug menu and check all.

Share this post


Link to post
Share on other sites
Ok, I'm guessing it's a driver issue then. I'm on an older laptop with an integrated Intel graphics card. I created a basic application with just a simple window. I got the same exception when I tried to create the d3d device, so I'm pretty sure it isn't my code. I'll just ignore it for now. Thank you, that helped a lot.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!