PRB: Stack Violation Calling 16-Bit DLL with FoxToolsID: Q139070 3.00 WINDOWS kbprg kbprb The information in this article applies to:
SYMPTOMSUsing the FOXTOOLS CallFn()function to call a 16-bit DLL and passing a "L" as an argument generates the error "Stack Violation. Please check the parameters." The same function call works well with FoxPro for Windows versions 2.x.
CAUSEThe function is registered and called as follows.
In this call, the "L" parameter, which represents a long argument, is
passed to the DLL. The API function expects a short argument, and the stack
allocated for the parameter is filled. The "S" argument, which represents a
short integer, should be passed instead.
In the version of Foxtools shipped with FoxPro versions 2.x for Windows the "S" argument was not valid. Additionally, the version of Foxtools.fll shipped with Visual FoxPro version 3.0 checks parameters more strictly than previous versions.
RESOLUTIONWhen registering a function from a 16-bit DLL, pass an "S" instead of an "L" as in this example:
For more information about Foxtools.fll and the syntax you can use, please
see the Foxtools.hlp file located in the Vfp\Tools directory.
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce BehaviorThe following example program duplicates the error. To correct it, change the "L" parameter to "S".
Additional reference words: 3.00
KBCategory: kbprg kbprb
KBSubcategory: FxprgFoxtools
|
Last Reviewed: December 15, 1995 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |