PRB: GetPrivateProfileString() Generates "Data Type Mismatch"
Article ID: 121416
Article Last Modified on 11/17/2003
APPLIES TO
- Microsoft Visual FoxPro 3.0 Standard Edition
- Microsoft FoxPro 2.6 Standard Edition
- Microsoft FoxPro 2.6a Standard Edition
This article was previously published under Q121416
SYMPTOMS
When you call the GetPrivateProfileString) Windows API function from within
FoxPro for Windows and the UDFPARMS setting is REFERENCE, you will receive
the error message "Data type mismatch."
CAUSE
This error occurs because GetPrivateProfileString() is expecting certain
parameters to be passed by VALUE. With the UDFPARMS set to REFERENCE, you
are sending all parameters by REFERENCE. The GetPrivateProfileString()
function returns an error because it is expecting these parameters by
VALUE. FoxPro interprets the error as a data type mismatch.
RESOLUTION
To prevent this behavior, set UDFPARMS to VALUE.
Additional query words: VFoxWin FoxWin 2.50 2.50a 2.50b errmsg
Keywords: KB121416