Some technical background​

When an application is loaded, the operating system's image loader examines the import directory of the exe file. In this import directory the dll names with their functions (so-called procedure entry points) are listed, which are needed for the application. These necessary dlls are then examined and their respective import directories are treated in the same way.

If the image loader finds and loads a dll by name, it may turn out that it does not export all the expected functions. The user is then informed about this fact with an error message.

Capture.PNG


In this example, the error dialog tells us about a problem loading the binary file pbuild.exe. The image loader detected a reference to the procedure DataObject in the import directory, but found this procedure to not exist in the corresponding dll. Unfortunately, the information which dll is expected to contain the required entry point is not included in the dialog.

When an application loads a dll dynamically at runtime with DllLoad() or DbeLoad(), the image loader examines the import directories of all required dlls in the same way as described above. If in this case not all required functions are exported from the dlls, DllLoad() or DbeLoad() will fail and no error dialog will be displayed.

Cause​

In all cases when the dialog "Entry Point Not Found" appears, the cause is a version mismatch between one or more parties from this list:
  • The application implemented in Xbase++.
  • A dll belonging to the application developed with Xbase++.
  • A third-party dll developed in Xbase++.
  • A dll that belongs to the Xbase++ runtime environment.
  • Another dll
In most cases, a dll version mismatch occurs if Xbase++ runtime libraries are installed on the developer machine in a different directory than the Xbase++ installation directory. By default, the installation directory is "C:\Program Files (x86)\Alaska Software\". On 32 bit operating systems, it is "C:\Program Files\Alaska Software\".

How to avoid​

The consideration of these possible causes leads directly to two golden rules:
  1. On a developer machine, Xbase++ runtime libraries must only exist in the directories created by the Xbase++ installer.
  2. On an end-user machine, the Xbase++ runtime libraries must always be placed into the same directory as the application (.exe or .dll developed in Xbase++). All runtime libraries must be deployed as a single unit. Exchanging individual dlls, i.e. the mixing of different versions, is not permitted.
The second rule implies that different versions of the Xbase++ runtime libraries may exist on the same machine, but never in the same directory.

Exceptions to these rules are very difficult to formulate and sooner or later inevitably lead to stability problems that have to be corrected at great expense.

Analysis​

It was already mentioned that the dll which is responsible for the error message "Entry Point Not Found", is unfortunately not named in the error message, and neither is the directory from which it was loaded. However, thankfully it is often very easy to identify the cause of the error.

Xppload.exe​

The command line tool xppload.exe is part of every Xbase++ installation. The tool searches for a large number of Xbase++ runtime libraries and prints information if, from where and which version can be found. On a developer machine, Xbase++ runtime libraries that do not originate from the installation directory and whose version does not match the installed Xbase++ version must be removed. If necessary Xbase++ has to be reinstalled.

To call xppload.exe, open a command line (cmd.exe) and change to the directory where the Xbase++ application is located or to the directory where you want to examine the available Xbase++ runtime libraries. Pass the command line option "version" to the tool.

Code:
C:\Users>xppload version
Alaska XppLoad Version 2.00.1430
Copyright (c) Alaska Software 1997-2021. All rights reserved.

C:\Program Files\Alaska Software\xpp20\bin\xpp.exe         Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\alink.exe       Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\aimplib.exe     Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\arc.exe         Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\xppdbg.exe      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\xppfd.exe       Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\xppfilt.exe     Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\xpppp.dll       Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\xpprle.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\xppcfe.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\xpperr.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\xppgraph.dll    Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\xppcbe.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\xppgen.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\xppsrtl.dll     Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\xppsys.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\xpprt1.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\xppui1.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\xppui2.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\xppnat.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\ascom10.dll     Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\ascom10c.dll    Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\adac20b.dll     Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\adac20c.dll     Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\asrdbc10.dll    Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\dbfdbe.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\ntxdbe.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\foxdbe.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\cdxdbe.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\bin\cxc-builder.exe Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\deldbe.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\sdfdbe.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\adsdbe.dll      Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\odbcdbe.dll     Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\pgdbe.dll       Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\xbtbase1.dll    Version: 2.0.1430
C:\Program Files\Alaska Software\xpp20\lib\xbtbase2.dll    Version: 2.0.1430

38 file(s) processed.

Note in the above output that xppload.exe also lists the versions and localities of the Xbase++ command line tools and corresponding dlls (eg. compiler, linker and others). These must not be present in an end-user installation. Therefore, any errors xppload.exe may report for the command line tools can be ignored in this case.

dllinfo.exe​

The command line tool dllinfo.exe also is part of the Xbase++ installation. Dllinfo.exe examines the import directory of the binary file (.exe or .dll). As a next step, the dlls requested by the binary are searched and loaded. Any dlls that cannot be loaded by dllinfo.exe are candidates for the error "Entry Point Not Found".

Note the fact that dllinfo.exe is an application developed with Xbase++. If dllinfo.exe cannot be started, then xppload.exe can be used to investigate the cause.

Start a command line (cmd.exe) and change to the directory of the Xbase++ application. Call the tool dllinfo.exe and pass the command line options /r and the name of the Xbase++ application:

Code:
C:\Users\>dllinfo -r test.exe
DllInfo - DLL info utility Version 2.00.1430
Copyright (c) Alaska Software 2000-2021. All rights reserved.

Path name    : C:\Users\test.exe
Type         : non-Xbase++
Imported DLLs:
C:\Program Files\Alaska Software\xpp20\lib\XPPRT1.dll
C:\Program Files\Alaska Software\xpp20\lib\xppsys.dll
C:\Program Files\Alaska Software\xpp20\lib\XPPDBGC.dll
C:\WINDOWS\System32\ADVAPI32.dll
C:\Program Files\Alaska Software\xpp20\lib\ASRDBC10.dll
C:\WINDOWS\System32\CRYPT32.dll
C:\WINDOWS\System32\GDI32.dll
C:\WINDOWS\System32\KERNEL32.DLL
C:\WINDOWS\SYSTEM32\MPR.dll
C:\WINDOWS\System32\USER32.dll
C:\WINDOWS\SYSTEM32\VERSION.dll
C:\WINDOWS\SYSTEM32\WINSPOOL.DRV
C:\WINDOWS\System32\WS2_32.dll
C:\Program Files\Alaska Software\xpp20\lib\XPPUI1.dll
C:\Program Files\Alaska Software\xpp20\lib\XppNat.dll
C:\Program Files\Alaska Software\xpp20\lib\som.dll
C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.844_none_89e26e970b35ab92\COMCTL32.dll
C:\WINDOWS\System32\RPCRT4.dll
C:\WINDOWS\System32\SHELL32.dll
C:\WINDOWS\System32\comdlg32.dll
C:\Program Files\Alaska Software\xpp20\lib\xppdui.dll
C:\Program Files\Alaska Software\xpp20\lib\xpprt2.dll
C:\Program Files\Alaska Software\xpp20\lib\ASCOM10.dll
C:\Program Files\Alaska Software\xpp20\lib\ASCOM10C.dll

Please note that dllinfo.exe can also be used to examine a dll.

Process Monitor​

The ultimate tool for root cause analysis is the Process Monitor (procmon.exe) from SysInternals (Microsoft). After the Procmon is started, a huge number of events are logged. This includes the loading operations for dlls. In the Process Manager log you can see for which library the loading failed.

The immense number of log entries can be limited, if necessary, by advanced filter settings. Details about the use of the Process Monitor can be found in its documentation: https://docs.microsoft.com/en-us/sysinternals/downloads/procmon.

The possibilities for analysis with Procmon go far beyond the scope of this article. However, it is important to know that the Procmon can also be used to investigate events that occur at runtime of the application. Consequently, errors can be found when using dynamic loading with a dll via DllLoad() and DbeLoad().

Summary​

The "Entry Point Not Found" dialog is displayed if a Dll in the Import Directory of the .exe or in the Import Directory of a Dll to be loaded does contain a reference established at link-time.

The command line tools xppload.exe and dllinfo.exe can be used to identify the problematic Dll. These tools are available in every Xbase++ installation. Alternatively, the Process Monitor from SysInternals can be used to find the dll that is responsible for the failure of the loading process.