Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetLastError returning zero
Message
From
02/12/2003 18:15:46
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
GetLastError returning zero
Miscellaneous
Thread ID:
00855237
Message ID:
00855237
Views:
81
When I call GetLastError() from within a VFP MTDLL, it only seems to work the first time. Subsequent calls all return zero until I reset IIS. I am wondering if I am misunderstanding or doing something wrong.

The stripped down example below demonstrates this. The ASP page shows a "5" when first loaded and zero for all subsequent refreshes. It remains zero even in a separate browser session until IIS is reset.

Thanks for any and all assistance.

MTDLL class code
----------------

DEFINE CLASS testGLE AS Session OLEPUBLIC

FUNCTION m_TestLastError

LOCAL ln_Return

ln_Return = 0

DECLARE Integer GetLastError IN WIN32API
DECLARE SetLastError IN WIN32API Integer ln_Error

*-- Test get last error
SetLastError(5)
ln_Return = GetLastError()

CLEAR DLLS SetLastError, GetLastError

RETURN ln_Return

ENDFUNC

ENDDEFINE

ASP page
--------
<%@ CodePage=65001 Language=JavaScript%>
<%
lo_Test = Server.CreateObject("testGLE.testGLE");
Response.Write(lo_Test.m_TestLastError()) ;
Response.End();
%>
Reply
Map
View

Click here to load this message in the networking platform