WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Memory and System Resources

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Run in Separate Memory Space

Keywords:  IntControl(51,2048,0,0,0)  

Question:

I have an application I want to execute from my compiled WinBatch program. I'm running on NT 3.51, and need to do the equivalent of setting the "Run in separate memory space" check box, as in a Program Manager icon's properties. The default behavior seems not to be a separate memory space; can I affect this directly from WinBatch?

Answer:

Separate memory Space...

Look in the WIL help file for IntControl(51,2048,0,0,0). and put that in your script before your Run command.

In NT4.0, you could also create a shortcut PIF file, that has those options selected in the properties, and then distribute that PIF file with the compiled Winbatch EXE.

Question (continued):

I tried the IntControl(51,2048,0,0,0) call, but the application does not behave like it does with Progman's Separate Memory Space checkbox on.

What I've got is a VB application that is probably looking for a different version of a VBX than that loaded by another application that must be running (for other reasons). If the memory space flag is not set, I see some memory corruption in some of the controls on the screen (background colors, etc.) Setting the flag causes the corruption to disappear, but calling IntControl does not. Any other ideas?

Answer:

The flag is supposed to do it. You might read up on the other flags available. The fact that it affects other controls means something is seriously wrong...

Question:

We need to run a 16 bit app, but before running, we need to modify the path environment. How can we do this?

Answer:

One solution is to add the path information to the App Path area in the registry - HKLM/Software/Microsoft/Windows/Current Version/App Paths

Here, a path is associated with an executable program, and I have used this technique successfully for the odd legacy app as an alternative to modifying the environment. It really depends on whether your 16 bit app runs as a single EXE or calls lots of other EXE's, but test and see if in doubt..


Article ID:   W13436
Filename:   Run in Separate Memory Space under NT.txt
File Created: 1999:04:15:16:54:00
Last Updated: 1999:04:15:16:54:00