| Previous | Next |
| CO_E_CANTDETERMINECLASS | CO_E_IIDSTRING |
CO_E_CLASSSTRING
Invalid class string
Windows defines CO_E_CLASSSTRING as 2147746291 (0x800401F3; signed value -2147221005). The documented description is “Invalid class string”. A textual class identifier cannot be converted into a valid CLSID. The relevant operation is CLSIDFromString or another activation path that accepts class text.
Where it is raised
- Associate this result with one exact operation in thread apartment initialization, GUID parsing, class-object discovery, local-server launch, and single-use class-factory registration.
- Confirm that this result came from CLSIDFromString or another activation path that accepts class text, rather than from cleanup or a wrapper that ran afterward.
Telemetry checklist
A useful incident records the thread ID and apartment request, CLSID text, IID text, class context, server executable or DLL path, process launch result, class-factory registration flags, timeout, and activation generation.
- Log a sanitized exact-length representation of the input.
- Separate CLSIDFromString from CLSIDFromProgID semantics.
- Validate configuration before attempting activation.
Why it is specific
- It can result when the GUID syntax is malformed or truncated.
- It can result when a ProgID is supplied to an API expecting brace-form CLSID text.
- It can result when encoding, whitespace, or configuration substitution corrupts the identifier.
Investigation order
- Identify the exact object, method, and lifecycle phase involved in CLSIDFromString or another activation path that accepts class text.
Safe handling
Correction: correct the class string or call the API appropriate for a ProgID, then activate using the parsed CLSID. Retry condition. Retry only with changed input; registry repair does not fix malformed GUID syntax. Before repeating the operation, balance successful CoInitializeEx calls on the same thread, revoke only class objects actually registered, and determine whether a local server or single-use factory already served a request.
Practical scenario
A configuration stores “Word.Document” in a field consumed by CLSIDFromString; using CLSIDFromProgID resolves the intended ProgID.
Difference from related HRESULTs
REGDB_E_CLASSNOTREG can follow successful parsing when the CLSID is not installed; it fails before registration lookup.
Developer and administrator guidance
Record the activation phase, parse GUID text before lookup, initialize every participating thread explicitly, and make class-object registration lifetime visible in server state. Regression coverage should include uninitialized and incompatibly initialized threads, malformed CLSID and IID text, missing applications, launch failure, factory-registration races, and single-use consumption.
Verify the registered application and server executable with the supported installation path; thread initialization and class-factory lifetime defects require code fixes rather than registry improvisation.
References
Looking for a different code? Search another status or error code.
