Microsoft KB Archive/101291: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 12: Line 12:
<div id="TitleRow">
<div id="TitleRow">


= <span id="KB101291"></span>&quot;Invalid Function&quot; with CallFn() from FoxTools =
= <span id="KB101291"></span>"Invalid Function" with CallFn() from FoxTools =




Line 45: Line 45:
== SUMMARY ==
== SUMMARY ==


The FOXTOOLS.FLL library is used to call Windows API functions from within FoxPro. However, FOXTOOLS.FLL cannot call a .DLL that requires more than nine parameters. If an attempt is made to call a .DLL with more than nine parameters, FoxPro will return the &quot;Invalid Function, Argument, Type or Count&quot; error message.<br />
The FOXTOOLS.FLL library is used to call Windows API functions from within FoxPro. However, FOXTOOLS.FLL cannot call a .DLL that requires more than nine parameters. If an attempt is made to call a .DLL with more than nine parameters, FoxPro will return the "Invalid Function, Argument, Type or Count" error message.<br />
<br />
<br />
The following example demonstrates this problem. It calls a function named &quot;Beep&quot; in a .DLL named &quot;Mydll.dll&quot; with ten parameters. When the CallFn() function that is part of FOXTOOLS.FLL is issued, FoxPro returns the error message described above:
The following example demonstrates this problem. It calls a function named "Beep" in a .DLL named "Mydll.dll" with ten parameters. When the CallFn() function that is part of FOXTOOLS.FLL is issued, FoxPro returns the error message described above:
<pre class="codesample">  SET LIBRARY TO SYS(2004)+&quot;FOXTOOLS.FLL&quot;t!
<pre class="codesample">  SET LIBRARY TO SYS(2004)+"FOXTOOLS.FLL"t!
   test='TEST'
   test='TEST'
   handle=REGFN(&quot;beep&quot;, &quot;CCCCCCCCCC&quot;, &quot;&quot;, &quot;c:\msvc\example\dlls\mydll.dll&quot;)
   handle=REGFN("beep", "CCCCCCCCCC", "", "c:\msvc\example\dlls\mydll.dll")
   test=CALLFN(handle,test,test,test,test,test,test,test,test,test,test)
   test=CALLFN(handle,test,test,test,test,test,test,test,test,test,test)
   SET LIBRARY TO
   SET LIBRARY TO

Latest revision as of 09:19, 20 July 2020

Knowledge Base


"Invalid Function" with CallFn() from FoxTools

Article ID: 101291

Article Last Modified on 10/15/2003



APPLIES TO

  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft FoxPro 2.5b



This article was previously published under Q101291

SUMMARY

The FOXTOOLS.FLL library is used to call Windows API functions from within FoxPro. However, FOXTOOLS.FLL cannot call a .DLL that requires more than nine parameters. If an attempt is made to call a .DLL with more than nine parameters, FoxPro will return the "Invalid Function, Argument, Type or Count" error message.

The following example demonstrates this problem. It calls a function named "Beep" in a .DLL named "Mydll.dll" with ten parameters. When the CallFn() function that is part of FOXTOOLS.FLL is issued, FoxPro returns the error message described above:

   SET LIBRARY TO SYS(2004)+"FOXTOOLS.FLL"t!
   test='TEST'
   handle=REGFN("beep", "CCCCCCCCCC", "", "c:\msvc\example\dlls\mydll.dll")
   test=CALLFN(handle,test,test,test,test,test,test,test,test,test,test)
   SET LIBRARY TO
                

MORE INFORMATION

The functionality of Microsoft FoxPro for Windows can be enhanced by calling a Windows .DLL within FoxPro. FoxPro for Windows comes with a FoxPro application programming interface (API) library that allows FoxPro programs to call Windows DLL functions that meet the criteria as described in the FOXTOOLS.WRI file in the FOXPROW\GOODIES\FOXTOOLS directory. A large number of Windows API functions meet these criteria.


Additional query words: VFoxWin FoxWin 2.50 FOXTOOLS Callfn error

Keywords: kberrmsg KB101291