Microsoft KB Archive/106704

{| = PRB: General Protection Fault When Using FOXTOOLS.FLL =
 * width="100%"|

ID: Q106704

2.50 2.50a 2.50b WINDOWS kbprg kbprb

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a, and 2.5b

SYMPTOMS
A general protection (GP) fault occurs when you are using FOXTOOLS.FLL.

CAUSE
RegFn or CallFn is incorrectly declared. The argument type and return argument type must be the same; otherwise, a general protection (GP) fault may possibly occur.

RESOLUTION
Make the argument type and return argument type the same. For example, the following function is incorrectly declared:

SET LIBRARY TO SYS(2004)+'FOXTOOLS.FLL' x=REGFN('GetDriveType','I','C') y=CALLFN(x,1) To correct the problem, modify the function as follows: SET LIBRARY TO SYS(2004)+'FOXTOOLS.FLL' x=REGFN('GetDriveType','I','I') y=CALLFN(x,1)

MORE INFORMATION
FOXTOOLS.FLL is a library that is supplied with FoxPro for Windows. FOXTOOLS.FLL allows FoxPro programs to call any Windows DLL functions that meet the following requirements:

1. Take the following arguments: integer, long, float, double,

string/buffer. These can be passed by reference or by value. 2. Return the following types: integer, long, float, double, string/buffer. These are returned by value only. Two FLL functions are used provide this functionality: RegFn - registers a function and the arguments it takes CallFn - calls a registered function RegFn and CallFn have the following syntax: RegFn(FunctionName, ArgTypes, ReturnType, DLLName) returns FnHandle

CallFN(FnHandle, Arg1, Arg2, ....) returns a value