CreateDCRenderTarget
(1)
MTargetProperties.pixelFormat.alphaMode
(1)
ZG9jc2NobmlwcA
(1)
DCRenderTarget
(1)
MTargetProperties.pixelFormat.format
(1)
RenderTargetProperties
(1)
BindDC
(1)
MTargetProperties.usage
(1)

Direct2D, suspicious error output in console

Asked By docschnipp
01-Nov-09 11:13 AM
when using Direct2D, I am getting a suspicious error message in the console
during the RenderTarget->BeginDraw() call:

First-chance exception at 0x75bfb727 in testd2dui.exe: Microsoft C++
exception: _com_error at memory location 0x0018ea60..

the code that creates my DCRenderTarget is as follows:

...
mHelper = new ContextInternals();
mHelper->mTargetProperties = D2D1::RenderTargetProperties();
mHelper->mTargetProperties.pixelFormat.format =
DXGI_FORMAT_B8G8R8A8_UNORM;
mHelper->mTargetProperties.pixelFormat.alphaMode =
D2D1_ALPHA_MODE_IGNORE;
mHelper->mTargetProperties.usage =
D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE;

HRESULT f =
mHelper->mFactory->CreateDCRenderTarget(&mHelper->mTargetProperties,&(mHelper->mGraphics));
mHelper->mRect = rect;
mHelper->mGraphics->BindDC( (HDC) systemContext,  &mHelper->mRect);
mHelper->mGraphics->BeginDraw(); //<- issues error message
...

can anyone give me a hint why this is happening? Is one of the parameters
for the TargetProperties not chosen well?

thanks
doc

[Please do not mail me a copy of your followup]=?Utf-8?B?ZG9jc2NobmlwcA==?

legalize+jeeve replied to docschnipp
01-Nov-09 05:45 PM
[Please do not mail me a copy of your followup]

=?Utf-8?B?ZG9jc2NobmlwcA==?= <docschnipp@newsgroup.nospam> spake the secret code


Does that exception come all the way out to your code, or is it
handled by MS code?
--

"Richard [ Direct3D MVP]" wrote:The exception seems to be handled in

docschnipp replied to legalize+jeeve
02-Nov-09 02:02 PM
The exception seems to be handled in MS code, but logged to the console.
I just wonder if it is something I need to be concerned about, maybe wrong
parameters to the TargetProperties or so...?

I have seen that more people found this, but yet, no one had a good answer to
it, just the usual hints to check your parameters to the function.

thanks
doc

"docschnipp" wrote:actually it only seems to happen, when I am debugging via

docschnipp replied to docschnipp
02-Nov-09 05:47 PM
actually it only seems to happen, when I am debugging via remote terminal,
not when I am sitting right in front..

could this be it?

thanks
doc
[Please do not mail me a copy of your followup]=?Utf-8?B?ZG9jc2NobmlwcA==?
legalize+jeeve replied to docschnipp
02-Nov-09 05:48 PM
[Please do not mail me a copy of your followup]

=?Utf-8?B?ZG9jc2NobmlwcA==?= <docschnipp@newsgroup.nospam> spake the secret code


If it does not come back to your code as a failed error code or
anything else, then its nothing you need to be concerned about.
--
Post Question To EggHeadCafe