C++/VB - 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
CreateDCRenderTarget
(1)
MTargetProperties.pixelFormat.alphaMode
(1)
ZG9jc2NobmlwcA
(1)
DCRenderTarget
(1)
MTargetProperties.pixelFormat.format
(1)
RenderTargetProperties
(1)
BindDC
(1)
MTargetProperties.usage
(1)
  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?
--
  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 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
  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.
--
help
first time, when I just created the render target. Calling Sequence is: if (!mTarget) { mFactory-> CreateDCRenderTarget(. . ., mTarget); } mTarget-> BindDC(dc, rect); mTarget-> BeginDraw(); . . . . / / now comes stuff like loading bitmaps and drawing to do to be able to reuse a target? Thanks doc Win32 DirectX Graphics Discussions CreateDCRenderTarget (1) DCRenderTarget (1) BindDC (1) RenderTarget (1) BeginDraw (1) EndDraw (1) MFactory (1) MTarget (1