Excel4v() Function Prototype May Require Modifications (95889)



The information in this article applies to:

  • Microsoft Excel Software Development Kit 4.0

This article was previously published under Q95889

SUMMARY

To use the Excel4v() function in small or medium memory model dynamic-link libraries (DLL), it may be necessary to modify the Excel4v() prototype in XLCALL.H. The need for this modification depends on the compiler used.

The Excel4v() function is prototyped in XLCALL.H as follows:
  int far pascal Excel4v(int      xlfn,
                         LPXLOPER operRes,
                         int      count,
                         LPXLOPER far opers[]);
				
Borland C++ version 3.1 and Microsoft C++ version 7.0 do not allow far pointers to arrays. If this Excel4v() prototype is used with these compilers, the far keyword is ignored. To correct this problem, modify the last formal argument to resemble the following:
   LPXLOPER far *opers
				
This modification is not necessary for large or compact memory model DLLs, because pointers are far by default in these memory models.

MORE INFORMATION

The following are the error messages produced when the unmodified prototype for the Excel4v function is used:

In Microsoft C++ 7.0:
Warning C4040: memory attribute on 'opers' ignored
In Borland C++ 3.1:
Suspicious pointer conversion
Borland C++ 3.1 is manufactured by a vendor independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.

Modification Type:MajorLast Reviewed:9/25/2003
Keywords:KB95889