Windows 3.1 Application Compatibility (part 4 of 7)Last reviewed: July 23, 1997Article ID: Q80899 |
3.10
WINDOWS
kbtool 31compattest
The information in this article applies to:
SUMMARY
Application Compatibility Document for Windows 3.1Due to the amount of information in this document, it has been broken into seven pieces. To find all seven pieces of this document and the Windows 3.1 Compatibility Test checklist, query this knowledge base on the words:
prod(winsdk) and 31compattest PARAMETER VALIDATIONWindows strictly checks parameters passed to its functions before using them. In a Windows version 3.0 application, Windows works around many validation errors and lets the function or application continue to function. In a Windows version 3.1 application, many of these errors cause the functions to fail, and the developer must ensure that structures and parameters are passed correctly. For example, in Windows version 3.0, if an application passes NULL as the hInstance parameter to CreateWindowEx, Windows maps the handle to the stack segment. In Windows version 3.1, the function returns an error value. The SDK release notes describe this in more detail. In some cases, the system may reject valid parameters incorrectly and cause applications to misbehave. Microsoft plans to correct any such occurrences.
UNDELETED OBJECT NOTIFICATIONSIn Windows version 3.1, any GDI or USER object left allocated when an application terminates results in a warning to the debug terminal. Windows version 3.1 does not automatically free these objects; the application must free them. These warnings usually imply a memory leakage; running and terminating an offending application eventually uses up all available memory. In some cases applications (and DLLs) allocate objects that are intended to stay around longer than the application that created them. This occurs frequently in shared DLLs that share GDI objects such as bitmaps and brushes among their many clients. In such cases, ignore the warnings at the debug terminal.
Potential ProblemApplications can eventually use up available memory, which seriously degrades system performance.
TestUse the Program Manager to check memory usage before and after running your application. Follow these steps:
MENU IMPLEMENTATIONWindows version 3.1 has enhanced menu management. In particular, the TrackPopupMenu function allows additional parameters, and Windows stores application menu data in a separate heap, expanding the number of windows that may exist. In Windows version 3.0 applications, Windows sends a WM_COMMAND message using the SendMessage function. In Windows version 3.1 applications, Windows sends the message using the PostMessage function, preventing the potential for overflowing a stack when dealing with pop-up menus.
REGISTERCLASSIn Windows version 3.0, Windows fails to free the window-class background brush properly when deleting the class. In Windows version 3.1, Windows frees the brush when either a Windows version 3.0 or 3.1 application terminates.
Potential ProblemA multiple-instance application that deletes the background brush may unintentionally delete a brush when other instances of the application are running.
TOPMOST WINDOWA new window attribute allows a window to be placed on top of all other windows, even when the owning application is not active. If multiple applications have topmost windows, the topmost window is ordered the same as owning applications. Also, a topmost window, its owners, and all windows it owns stay together as windows are moved around. Thus, if you bring an owned dialog window to the top, its owner is also brought forward so that it stays immediately below the dialog box.
Potential ProblemApplications that depend on being able to have windows of other applications between their main window and a dialog box may encounter problems. For example, a Setup program that starts Notepad and then brings up a dialog box causes Notepad to be positioned behind the dialog box owner. The solution is to create the dialog box without an owner (a window may not be owned by a window of another application).
Potential ProblemAny application that relies on having an unobstructed client area when active may encounter problems because the active window cannot be guaranteed to be on top. Thus, the active window may not have a rectangular clipping region because a topmost window may be on top of it. Calling BitBlt with a window or screen DC as the source (which is not recommended in any case) may copy bits belonging to the topmost window.
Tests
|
Additional reference words: 3.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |