Hi
I've been making a patch to following function:
void CXTPControl::DoPropExchange(CXTPPropExchange* pPX)
I created a new Schema version and set it to the current version in XTPPropExchange.inc #define _XTP_SCHEMA_1350 (0x26) #define _XTP_SCHEMA_CURRENT _XTP_SCHEMA_1350
....
Inside the DoPropExchange function I added:
...
if (pPX->GetSchema() > _XTP_SCHEMA_1340) XTP_SHORTCUTMANAGER_ACCEL command; pCommandBars->GetShortcutManager()->ResolveCommand(&command,true); CString idstr(command.cmd_name); PX_String(pPX, _T("ID_TAG"), idstr, _T("")); else if (pPX->IsLoading()) PX_String(pPX, _T("ID_TAG"), idstr, _T("")); XTP_SHORTCUTMANAGER_ACCEL command; _snprintf(command.cmd_name,sizeof(command.cmd_name),"%s",idstr); pCommandBars->GetShortcutManager()->ResolveCommand(&command,false); ...
The idea being that storing the numerical number for id is pretty bad since the resource.h file that these ids are defined in can change underneath the toolkit invalidating the registry. So instead I look up and store the actual string tag name, and resolve that back into / from the ID when saving and loading.
However, despite adding a new schema for my specific change I am now getting
CArchiveException thrown, and caught the cause parameter indicates 'badindex'. However I placed breakpoints on everywhere in the xt code I could find the CArchiveException being thrown and I could not find anywhere it was being thrown. Looks like its coming from within microsofts platform libraries.
Any help / better understanding on what I could be doing wrong would be great.
I've debugged my new parameter and it is indeed being resolved correctly. to the string and vice versa. However I cannot check the registry values because they appear to be a compressed byte stream of the objects serialised. This is making it all very hard to debug and understand what has gone wrong.
The only thing I can think off is that I've exceeded some capacity limit on the amount of data the control object can serialize however that seems a rather arbitrary reason.
Has anyone got any experience with this?
Many thanks Jm
|