|
|
|
If you heavily use API calls and strictly follow the SDK documentation, you might be tempted to use the GetLastError API to retrieve the error returned by your last API function or procedure. However, this function doesn't always return valid error codes, because Visual Basic internally does a lot of calls to the Windows API, therefore it is highly likely that the value returned by the GetLastError function actually refers to one of those internal calls, rather than your most recent explicit call.
To work around this problem, just use the LastDLLError property of the Err object. Visual Basic always caches in this property the error code returned by any call to a routine to the Windows API. Unfortunately, you cannot disable this mechanism, which means that all your calls to the API are slowed down, even if you're not interested in error codes. |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|