I'm not great at MFC and copy examples in areas I do not fully understand. In my InitInstance() I have the standard line
ProcessShellCommand(cmdInfo) which eventually calls
pFrame = CreateNewFrame(pDocument, NULL);
by debugging the program it is this statement that is taking 20+ seconds.
So persumably I am clogging up some resource somewhere.
It would be great if somebody could point me in the right direction and also say what I should be doing in future to stop this accumulation.