| Previous | Next |
| D2DERR_BAD_NUMBER | D2DERR_LAYER_ALREADY_IN_USE |
D2DERR_WRONG_FACTORY
D2DERR_WRONG_FACTORY means that objects passed to the same Direct2D operation were created from different ID2D1Factory instances. Factory affinity is part of the object contract, so otherwise similar resources cannot always be mixed.
What to check
- Keep one explicit factory ownership path for resources that must interact.
- Do not cache resources across independently initialized graphics subsystems without checking their factory origin.
- Recreate the resource from the factory associated with the current target when necessary.
Comparing only interface types is not enough; the creating factory matters too.
Microsoft: Direct2D error codes
Looking for a different code? Search another status or error code.