afritz1

I used the Compatibility Administrator to apply shims to an application which
otherwise would not work with vista.
If this application calls another application (in this case Word 2007) the
called application seems to inherit the shims and brings errors.
The shims I used are:
Win98VersionLie, HeapPadAllocation, noPaddedBorder, XPFileDialog

Can I avoid the inheritance or can I tell Vista not to use any shims for Word


Re: Application Compatibility for Windows Vista Application with shims calls another application

Bruce N. Baker - MSFT

How are you starting the other process




Re: Application Compatibility for Windows Vista Application with shims calls another application

afritz1

I actually do not know how the other process is started because I do not have the source code of the library (where it happens) my application uses.

But maybe an example helps:

Application A only works with shims.
Application B only works with shims.
B called from A (shims) works without shims.
Word 2007 called from A (shims) crashes.
Word 2007 called from Explorer works.
Java Virtual Machine called from A (shims) crashes.
Java Virtual Machine called from Explorer works.

I tried to install the sdb on another machine as well.





Re: Application Compatibility for Windows Vista Application with shims calls another application

Rob Kenny - MSFT

When you create a custom sdb from CompatAdmin, the fixes are only applied to the identified exectuable and doesn't automatically apply to any child processes. When using the "Test Run..." button the fixes are applied to the exe and its child processes, confusing I know....

Check this registry key to see if you have any compatibility modes (applied from the PCA or compatibility tab) HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers






Re: Application Compatibility for Windows Vista Application with shims calls another application

afritz1

- Rob Kenny, thanks for reply

I checked the registry-key. "...\layers" is empty.

What did I do with the Compatibility Administrator:

- Start Compatibility Administrator as Administrator
- create custom compatibility mode with name "iks"
- apply following shims to the custom compatibility mode
- Win98VersionLie, HeapPadAllocation, noPaddedBorder, XPFileDialog
- new custom database
- create new application fix
- name = gemeinde
- path = C:\usr\freddy\sts\iksdev\gemeinde.exe
- operating system modes = NONE
- additional compatibility modes = "iks"
- Weiter, Weiter, Fertig Stellen (german vista)
- Save Database (name = iks)
- File, Install

I also installed the sdb on another machine with: sdbinst iks.sdb
Start Application gemeinde.exe which itself calls other applications.
If I start winword.exe from gemeinde.exe and afterwards send commands to Word via DDE, I get messages like this (I try to translate to english - I have a german Word):

Installation will be prepared

Wait until Word will be configured

The office-file "normal.dotn" cannot be opened because its contents brings troubles.

Word found an unreadable content of "normal.dotn". Would you like to reconstruct the content.

...

Visual Basic Runtime-Error -2147417848 (80010108). Automation Error, The called object was separated from the client.

...

gemeinde.exe crashed afterwards

When I open Word from Explorer and then start the DDE-Connection form gemeinde.exe, everything works fine. But what I see then when a DDE-Command opens a new Word-Window (empty Document) is some strange thing in the Window-Capture: "Document 2 [Compatibilitymode] - Microsoft Word".

When I call a Java-Program from gemeinde.exe I see similar things which look like inheritance of Compatibility-Shims.

I did NOT start the application with the test-Button in the Compatibility-Administrator.







Re: Application Compatibility for Windows Vista Application with shims calls another application

Rob Kenny - MSFT

Thanks for the additional info, I now see what's happening. A compatibility mode is a set of compatibility fixes with the additional property of automatically propgating to child processes. If you need your fixes to only apply to a single executable, skip creating the compatibility mode and apply the compatibility fixes directly to the exe:

- Start Compatibility Administrator as Administrator
- new custom database
- create new application fix
- name = gemeinde
- path = C:\usr\freddy\sts\iksdev\gemeinde.exe
- operating system modes = NONE
- Compatibility Fixes: Win98VersionLie, HeapPadAllocation, noPaddedBorder, XPFileDialog
- Weiter, Weiter, Fertig Stellen (german vista)
- Save Database (name = iks)
- File, Install






Re: Application Compatibility for Windows Vista Application with shims calls another application

afritz1

Rob Kenny:

Thanks for reply!

This actually was the solution.

Using a self-defined compatibility-mode forces the mode to inherit to subsequent called exes. Adding the shims directly to the exe brings no inheritance.