Okay I worked it out.
I had to set the working directory of the application I was trying to open with CreateProcess. Somehow I thought that would have been automatic. Obviously not.