Visual Prolog 7.4 Upgrade Notes
Template:Preliminary Documentation
This document describes how to upgrade Visual Prolog 7.3 projects to Visual Prolog 7.4, for older projects you should also read Visual Prolog 7.3 Upgrade Notes.
If you have problems with upgrading your projects and need additional information, you are welcome to ask questions in Visual Prolog Discussion Forum.
By default, the installation of Visual Prolog 7.4 will not replace any previously installed versions. It is possible to work with several versions on a single computer.
- The Commercial Edition will by default be installed in C:\Program Files (x86)\Visual Prolog 7.4 or C:\Program Files\Visual Prolog 7.4.
- The Personal Edition will by default be installed to C:\Program Files (x86)\Visual Prolog 7.4PE or C:\Program Files\Visual Prolog 7.4PE.
Visual Prolog 7.4 projects are backward-compatible with Visual Prolog 7.3 projects. If you are going to use different versions of Visual Prolog installed at one computer, avoid opening projects by double-clicking on prj6 files. Some changes might require automatic updates in Visual Prolog 7.3 projects. Therefore, it is recommended to make the project file (PRJ6) writable before the first build. Also, it is recommended to make copies of all project files first.
When your open a project in the Visual Prolog 7.4 IDE, it will automatically perform necessary updates of the project file. After this, it is recommended that you rebuild the entire project with the help of the Build | Rebuild All command and answer "Yes to All" to the messages suggesting adding or removing packages and include statements.
Notice that you should simply delete include directives to PFC files which cannot be found: proper include directives will (normally) be inserted automatically.
Manual updates
This section describes things that may need manual updates.
wParam, lParam & lResult
Event handlers and other such things may give errors like:
The expression has type 'core::booleanInt', which is incompatible with the type 'gui_native::lResult'
To maintain the compatibility between 32 and 64 bit programs it is necessary to pay special attention to the three types:
- gui_native::wParam
- gui_native::lParam
- gui_native::lResult
These types are used extensively in the Windows API and they have different size on the 32 and 64 bit platform.
The correct way to deal with these are:
Pointers and handles should be uncheckedConvert'ed to/from these types.
Numbers should be injected into these types using these gui_api predicates:
predicates mkW : (integer Integer) -> wParam WParam. mkW : (unsigned Unsigned) -> wParam WParam. mkL : (integer Integer) -> lParam LParam. mkL : (unsigned Unsigned) -> lParam LParam. mkR : (integer Unsigned) -> lResult LResult. mkR : (unsigned Unsigned) -> lResult LResult. % @short Make an wParam/lParam/lResult from an integer/unsigned. % @end
Numbers should be projected from these typese using these gui_api predicates:
predicates getUnsigned : (unsignedNative WParam) -> unsigned Integer language prolog as "gui_api_getParam". getUnsigned : (integerNative WParam) -> unsigned Integer language prolog as "gui_api_getParam". getUnsigned : (wParam WParam) -> unsigned Unsigned language prolog as "gui_api_getParam". getUnsigned : (lParam LParam) -> unsigned Unsigned language prolog as "gui_api_getParam". getUnsigned : (lResult LResult) -> unsigned Unsigned language prolog as "gui_api_getParam". getInteger : (unsignedNative WParam) -> integer Integer language prolog as "gui_api_getParam". getInteger : (integerNative WParam) -> integer Integer language prolog as "gui_api_getParam". getInteger : (wParam WParam) -> integer Integer language prolog as "gui_api_getParam". getInteger : (lParam LParam) -> integer Integer language prolog as "gui_api_getParam". getInteger : (lResult LResult) -> integer Integer language prolog as "gui_api_getParam". % @short Convert a wParam/lParam/lResult to an unsigned/integer. % @end
gui_api also defines a handy collection of constants of these types:
constants wNull : wParam = uncheckedConvert(wParam, nullHandle). wFalse : wParam = wNull. wTrue : wParam = uncheckedConvert(wParam, uncheckedConvert(handle, 1)). wMinusOne : wParam = uncheckedConvert(wParam, uncheckedConvert(handle, -1)). lNull : lParam = uncheckedConvert(lParam, nullHandle). lFalse : lParam = lNull. lTrue : lParam = uncheckedConvert(lParam, wTrue). lMinusOne : lParam = uncheckedConvert(lParam, uncheckedConvert(handle, -1)). rNull : lResult = uncheckedConvert(lResult, nullHandle). rFalse : lResult = rNull. rTrue : lResult = uncheckedConvert(lResult, wTrue). rMinusOne : lResult = uncheckedConvert(lResult, uncheckedConvert(handle, -1)). % @short Constant of type lwParam/lParam/lResult. % @end
Other types (like listViewControl::itemId) may have the same problem, because they are subtypes of one of the mentioned types.
classInfo
Some code may reference a classInfo predicate which no longer exists. The classInfo arguments are no longer used, and there is always another predicate that can be called istead of the one which is called.
The predicates in common_exception have replacements in exception; comExceptionCheck::check should be replaced with a call to a suitable version of check2 in the same class.