Information générale
Catégorie:
Applications Internet
Titre:
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();
%>
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement