• 10
• 13
• 18
• 27
• 9

# CreateHwndRenderTarget blocks the input like BlockInput

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

## Recommended Posts

Hey,

my loup lead me to the conclusion that sometimes if i call CreateHwndRenderTarget the input to my PC gets blocked.

This Message means: "MSVS Express 2013 detected that the Userinput is blocked. Possible solutions are a modal Dialog or a Task that requires a User Input Block."

I realy don't know why i get this message... I don't know what im doing wrong.

But still a small code snippet:

HRESULT CRenderTarget::fn_CreateDeviceResources(HWND hHwnd)
{
HRESULT hr = S_OK;
if (!m_pRenderTarget)
{
RECT rc;
GetClientRect(hHwnd, &rc);
D2D1_SIZE_U size = D2D1::SizeU(rc.right - rc.left, rc.bottom - rc.top);
hr = m_pDirect2dFactory->CreateHwndRenderTarget(D2D1::RenderTargetProperties(), D2D1::HwndRenderTargetProperties(hHwnd, size), &m_pRenderTarget);
}
return hr;
}


It's state-dependent wether CreateHwndRenderTarget blocks the input on the first call or the second call.

The strange thing is, that yesterday everthing works fine, but today i get this problem.

Perhaps anyone know this problem?

Thanks and sorry for my bad english.

Edited by Mr.Long

##### Share on other sites

Not a solution (maybe a clue), but are you getting that error only when running it in debug mode from within Visual Studio?

I ran into a similar problem some time ago (which I was not able to resolve). However, I found that I could run my application from the desktop (versus from within Visual Studio) without error. Some googling at the time indicated Visual Studio settings may have been corrupted but I wasn't able to find any changes or resetting that helped.

[ Ihr Englisch ist viel besser als mein Deutsch ]

Edited by Buckeye

##### Share on other sites

Interessant, dass man das rauslesen kann^^

The first thing i did: start Visual Studio with: WDExpress.exe /ResetSettings, so i think the Settings aren't the problem.

Then i tried executing the exe from the Explorer - the same Problem... But now, after some experience i was able to capture a Stacktrace:

(Take a look at the many error windows)

perhaps the Stacktrace give some  clarity... I do not.