That cannot be done with C++, you have to use the Win32 API (which should be available since you want to start the target application in Win98 compatibility mode). Your problem can be solved with 3 steps:

1) set up an environment block for the new process. You can read the current environment settings by calling GetEnvironmentStrings and copy them to the new environment settings

2) set the __COMPAT_LAYER variable to Windows98

3) call CreateProcess with the appropriate parameters (providing the newly created environment settings)