PRB: Error Message Cannot Load 32-bit DLL

Last reviewed: March 7, 1997
Article ID: Q164742
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0

SYMPTOMS

The following error occurs when you attempt to call a function in a 16-bit DLL that has been registered with the DECLARE-DLL command:

   Cannot load 32-bit DLL <path to DLL>

It may also seem to happen in calling the RegFn() function in FoxTools, if the incorrect syntax is used, after having registered the function with the DECLARE-DLL command.

STATUS

This behavior is by design. The DECLARE-DLL command should only be used to register 32-bit DLL functions in FoxPro. To register a function of a 16- bit DLL, use the RegFn function of the FoxTools.FLL library.

MORE INFORMATION

Steps to Reproduce Behavior

The following steps are for illustration purposes only -- the DLL in the example does not exist.

Type the following commands in the command window:

   DECLARE INTEGER TestFn IN Test16.dll INTEGER,INTEGER
   *** The error will occur on executing the next line of code
   ? TestFn(1,1)
   *** Removing the asterisk on the next line would resolve the error
   *** that occurs on the first RegFn() call below.
   * CLEAR DLLS

   SET LIBRARY TO HOME()+"FoxTools.FLL"
   *** The error will occur on executing the next line of code
   *** because it is attempting to call the TestFn() function registered
   *** above with the DECLARE-DLL command
   handle = RegFn(TestFn(),"II","I","Test16.DLL")
   * The correct way to register the function is...
   handle = RegFn("TestFn","II","I","Test16.DLL")
   ReturnValue = CallFn(handle, 1, 1)  && Note this works now

 

	
	


Keywords : FxprgFoxtools FxtoolLck kbprg kbtool vfoxwin
Version : 3.0 3.0b 5.0
Platform : WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 7, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.