General information
Category:
Internet applications
Title:
GetLastError returning zero
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only