ACC2000: Error Message: There Are Calls to 16-Bit Dynamic-Link Libraries

ID: Q224319


The information in this article applies to:
  • Microsoft Access 2000

Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).


ERROR MESSAGE

When you try to convert a Microsoft Access version 2.0 database to version 2000, you may receive the following error message:

There are calls to 16-bit dynamic-link libraries (.dll) in modules in this database.
These won't work under Microsoft Windows 95 or Microsoft Windows NT.

Change your code to call equivalent 32-bit dynamic-link libraries (.dll).
NOTE: Microsoft Office 2000 has built-in functionality that allows you to get more information about difficult-to-troubleshoot alerts or error messages. If you want to enable this functionality for this and other error messages in Microsoft Office 2000, please download the Microsoft Office 2000 Customizable Alerts file from the Microsoft Office Update Web site at the following address:
http://officeupdate.microsoft.com/2000/downloadDetails/alerts.htm
NOTE: If you reached this article by clicking the Web Info button in an error message, you already have Customizable Alerts enabled.


CAUSE

Because the architecture of Windows 95 and later and Windows NT is 32-bit, there are several differences in the application programming interface (API) from the 16-bit API of Windows 3.x.


WHAT TO TRY

Change your code to call equivalent 32-bit dynamic-link libraries (.dll).

Following is a listing of 16-bit and 32-bit Declare statements for common API calls that you can use as reference when you convert your code to 32-bit.

For additional information about converting API Calls for use in 32-bit applications, please see the following article in the Microsoft Knowledge Base:

Q210155 How to Convert API Calls from 16-bit to 32-bit

List of Converted Declaration Statements for Common API Functions

CloseClipboard

16-bit:

Declare Function CloseClipboard Lib "User" () As Integer 
32-bit:

Declare Function apiCloseClipboard Lib "user32" Alias _
   "CloseClipboard" () As Long 

ChooseColor

16-bit:

Declare Function ChooseColor_API Lib "COMMDLG.DLL" Alias _
   "ChooseColor" (pCHOOSECOLOR As ChooseColor) As Integer 
32-bit:

Type CHOOSECOLOR
   lStructSize As Long
   hwndOwner As Long
   hInstance  As Long
   RgbResult As Long
   lpCustColors As Long
   Flags As Long
   lCustData As Long
   lpfnHook As Long
   lpTemplateName As Long
End Type
Declare Function apiChooseColor Lib "comdlg32.dll" Alias _
   "ChooseColorA" (pChoosecolor As CHOOSECOLOR) As Long 
NOTE: You can use the ChooseColor functionality of this API by using the Common Dialog ActiveX control included with the Microsoft Office Developer.

EmptyClipboard

16-bit:

Declare Function EmptyClipboard Lib "User" () As Integer 
32-bit:

Declare Function apiEmptyClipboard Lib "user32" Alias _
   "EmptyClipboard" () As Long 

ExitWindows

16-bit:

Declare Function ExitWindows Lib "User" (ByVal dwReturnCode _
   As Long, ByVal wReserved As Integer) As Integer 
32-bit:

Declare Function apiExitWindows Lib "user32" Alias _
   "ExitWindows" (ByVal dwReserved As Long, ByVal uReturnCode _
   As Long) As Long 

FindExecutable

16-bit:

Declare Function FindExecutable Lib "Shell" (ByVal _
   lpszFile As String, ByVal lpszDir As String, ByVal _
   lpszResult As String) As Integer 
32-bit:

Declare Function apiFindExecutable Lib "shell32.dll" Alias _
   "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory _
   As String, ByVal lpResult As String) As Long 

FindWindow

16-bit:

Declare Function FindWindow Lib "user"(ByVal lpclassname As _
   Any, ByVal lpCaption As Any) As Integer 
32-bit:

Declare Function apiFindWindow Lib "User32" Alias "FindWindowA" _
   (ByVal lpclassname As Any, ByVal lpCaption As Any) as Long 

GetActiveWindow

16-bit:

Declare Function GetActiveWindow Lib "User" () As Integer 
32-bit:

Declare Function apiGetActiveWindow Lib "user32" Alias _
   "GetActiveWindow" () As Long 

GetClipboardData

16-bit:

Declare Function GetClipboardData Lib "User" (ByVal _
   wFormat As Integer) As Integer 
32-bit:

Declare Function apiGetClipboardData Lib "user32" Alias _
   "GetClipboardDataA" (ByVal wFormat As Long) As Long 

GetCursorPos

16-bit:

Declare Sub GetCursorPos Lib "User" (lpPoint As POINTAPI) 
32-bit:

Type POINTAPI
   x as Long
   y as Long
End Type

Declare Sub apiGetCursorPos Lib "User32" (lpPoint _
   As POINTAPI) 

GetDesktopWindow

16-bit:

Declare Function GetDesktopWindow Lib "User" () As Integer 
32-bit:

Declare Function apiGetDesktopWindow Lib "user32" Alias _
   "GetDesktopWindow" () As Long 
NOTE: You can also use GetWindow to perform the same function.

GetFileVersionInfo

16-bit:

Declare Function GetFileVersionInfo Lib "VER.DLL" _
   (ByVal lpszFileName As String, ByVal lpdwHandle As Long, _
   ByVal cbbuf As Long, ByVal lpvdata As String) As Integer 
32-bit:

Declare Function apiGetFileVersionInfo Lib "version.dll" _
   Alias "GetFileVersionInfoA" (ByVal lptstrFilename As _
   String, ByVal dwHandle As Long, ByVal dwLen As Long, _
   lpData As Any) As Long 

GetFileVersionInfoSize

16-bit:

Declare Function GetFileVersionInfoSize Lib "VER.DLL" _
   (ByVal lpszFileName As String, lpdwHandle As Long) As Long 
32-bit:

Declare Function apiGetFileVersionInfoSize Lib _
   "version.dll" Alias "GetFileVersionInfoSizeA" _
   (ByVal lptstrFilename As String, lpdwHandle As Long) As Long 

GetOpenFileName

16-bit:

Declare Function GetOpenFileName Lib "COMMDLG.DLL" _
   (OPENFILENAME As tagOPENFILENAME) As Integer 
32-bit:

Type tagOPENFILENAME
   lStructSize As Long
   hwndOwner As Long
   hInstance As Long
   lpstrFilter As String
   lpstrCustomFilter As String
   nMaxCustFilter As Long
   nFilterIndex As Long
   lpstrFile As String
   nMaxFile As Long
   lpstrFileTitle As String
   nMaxFileTitle As Long
   lpstrInitialDir As String
   lpstrTitle As String
   flags As Long
   nFileOffset As Integer
   nFileExtension As Integer
   lpstrDefExt As String
   lCustData As Long
   lpfnHook As Long
   lpTemplateName As String
End Type

Declare Function apiGetOpenFileName Lib "comdlg32.dll" _
   Alias "GetOpenFileNameA" (OPENFILENAME as tagOPENFILENAME) _
   As Long 

GetPrivateProfileString

16-bit:

Declare Function GetPrivateProfileString Lib "Kernel" _
   (ByVal lpApplicationName As String, ByVal lpKeyName As _
   Any, ByVal lpDefault As String, ByVal lpReturnedString As _
   String, ByVal nSize As Integer, ByVal lpFileName As String) _
   As Integer 
32-bit:

Declare Function apiGetPrivateProfileString Lib "kernel32" _
   Alias "GetPrivateProfileStringA" (ByVal lpApplicationName _
   As String, ByVal lpKeyName As Any, ByVal lpDefault As _
   String, ByVal lpReturnedString As String, ByVal nSize As _
   Long, ByVal lpFileName As String) As Long 

GetSaveFileName

16-bit:

Declare Function GetSaveFileName Lib "COMMDLG.DLL" _
   (OPENFILENAME As tagOPENFILENAME) As Integer 
32-bit:

Type OPENFILENAME
   lStructSize As Long
   hwndOwner As Long
   hInstance As Long
   lpstrFilter As String
   lpstrCustomFilter As String
   nMaxCustFilter As Long
   nFilterIndex As Long
   lpstrFile As String
   nMaxFile As Long
   lpstrFileTitle As Long
   nMaxFileTitle As Long
   lpstrInitialDir As String
   lpstrTitle As String
   Flags As Long
   nFileOffset As Integer
   nFileExtension As Integer
   lpstrDefExt As String
   lCustData As Long
   lpfnHook As Long
   lpTemplateName As String
End Type

Declare Function apiGetSaveFileName Lib "comdlg32.dll" _
   Alias "GetSaveFileNameA" (pOpenfilename as OPENFILENAME) As Long 
NOTE: You can achieve the same functionality with the Common Dialog OLE control included with the Microsoft Office Developer.

GetSystemDirectory

16-bit:

Declare Function GetSystemDirectory Lib "Kernel" _
   (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer 
32-bit:

Declare Function apiGetSystemDirectory Lib "kernel32" _
   Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, _
   ByVal nSize As Long) As Long 

GetVersion

16-bit:

Declare Function GetVersion Lib "Kernel" () As Long 
32-bit:

Declare Function apiGetVersion Lib "kernel32" Alias _
   "GetVersion" () As Long 

GetWindowsDirectory

16-bit:

Declare Function GetWindowsDirectory Lib "Kernel" _
   (ByVal lpbuffer As String, ByVal nsize As Integer) As Integer 
32-bit:

Declare Function apiGetWindowsDirectory Lib _
   "Kernel32" Alias "GetWindowsDirectoryA" (ByVal _
   lpbuffer As String, ByVal nsize As Long) As Long 

NetWkstaGetInfo

16-bit:

Declare Function NetWkstaGetInfo Lib "NetAPI.DLL" _
   (ByVal lServer As Long, ByVal sLevel As Integer, _
   ByVal pbBuffer As Long, ByVal cbBuffer As Integer, _
   pcbTotalAvail As Integer) As Integer 
32-bit:

Declare Function apiNetWkstaGetInfo Lib "NetAPI32.dll"_
   Alias NetWkstaGetInfo (ByVal lServer as Integer, ByVal _
   sLevel as Integer, ByVal pbBuffer as Long, cbBuffer as _
   Integer, pcbTotalAvail as Integer) As Integer 
NOTE: This function is available only in the Windows NT environment. You can use the CurrentUser() function to obtain the currently logged on user.

Playsound

16-bit:

Declare Function sndplaysound Lib "mmsystem" (ByVal _
   filename as String, ByVal snd_async as Integer) As Integer 
32-bit:

Declare Function apisndPlaySound Lib "winmm" Alias _
   "sndPlaySoundA" (ByVal filename As String, ByVal snd_async _
   As Long) As Long 

SetActiveWindow

16-bit:

Declare Function SetActiveWindow Lib "User" (ByVal _
   hWnd As Integer) As Integer 
32-bit:

Declare Function apiSetActiveWindow Lib "user32" _
   Alias "SetActiveWindow" (ByVal hwnd As Long) As Long 

SetSysModalWindow

16-bit:

Declare Function SetSysModalWindow Lib "User" _
   (ByVal hwnd As Integer) As Integer 
32-bit:

This function has been deleted. 

SetWindowPos

16-bit:

Declare Sub SetWindowPos Lib "User" (ByVal hWnd As Integer,_
   ByVal hWndInsertAfter As Integer, ByVal X As Integer, _
   ByVal Y As Integer, ByVal cx As Integer, ByVal cy _
   As Integer, ByVal wFlags As Integer) 
32-bit:

Declare Function apiSetWindowPos Lib "user32" Alias _
   "SetWindowPos" (ByVal hwnd As Long, ByVal _
   hWndInsertAfter As Long, ByVal x As Long, ByVal y _
   As Long, ByVal cx As Long, ByVal cy As Long, _
   ByVal wFlags As Long) As Long 

ShellExecute

16-bit:

Declare Function ShellExecute Lib "SHELL" (ByVal _
   hwnd As Integer, ByVal lpszOp As String, ByVal lpszFile _
   As String, ByVal lpszParams As String, ByVal lpszDir As _
   String, ByVal fsShowCmd As Integer) As Integer 
32-bit:

Declare Function apiShellExecute Lib "shell32.dll" Alias _
   "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As _
   String, ByVal lpFile As String, ByVal lpParameters As _
   String, ByVal lpDirectory As String, ByVal nShowCmd As _
   Long) As Long 

ShowWindow

16-bit:

Declare Function ShowWindow Lib "User" (ByVal hWnd _
   As Integer, ByVal nCmdShow As Integer) As Integer 
32-bit:

Declare Function apiShowWindow Lib "user32" Alias _
   "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As _
   Long) As Long 

WritePrivateProfileString

16-bit:

Declare Function WritePrivateProfileString Lib _
   "Kernel" (ByVal lpApplicationName As String, ByVal _
   lpKeyName As Any, ByVal lpString As Any, ByVal _
   lplFileName As String) As Integer 
32-bit:

Declare Function apiWritePrivateProfileString Lib _
   "kernel32" Alias "WritePrivateProfileStringA" _
   (ByVal lpApplicationName As String, ByVal lpKeyName _
   As Any, ByVal lpString As Any, ByVal lpFileName As _
   String) As Long 

Additional query words: OFF2000

Keywords : kbdta
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: September 15, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.