The DdeExitProc, which can be scheduled more than once, doesn't check that ddeInstance is 0 before operating. It should, shouldn't it? Also possibly check ddeIsServer before undoing the name service stuff?