Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetLastError returning zero
Message
De
02/12/2003 18:15:46
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
GetLastError returning zero
Divers
Thread ID:
00855237
Message ID:
00855237
Vues:
82
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
Fil
Voir

Click here to load this message in the networking platform