Desktop Functions: Smart Device Functions:
|
GetLastError (coredll)
coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for GetLastError in other DLLs exists, click on Find References to the right. C# Signature:
[DllImport("coredll.dll", SetLastError=true)] VB Signature:
Declare Function GetLastError Lib "coredll.dll" () As Int32 User-Defined Types:None. Notes:It is recommended that you do not call the Win32 GetLastError method directly. Because of the way P/Invoke works, the error message may get reset between Win32 calls in your code. Instead, call the Marshal.GetLastWin32Error method, which can be combined with the ever useful Marshal.ThrowExceptionForHR method. See below for an example. Tips & Tricks:You can look up Windows Mobile specific error codes here: http://msdn.microsoft.com/en-us/library/aa914935.aspx Please add some! Sample Code:C#
// don't use this! VB
// don't use! Alternative Managed API:Marshal.GetLastWin32Error(); Do you know one? Please contribute it! Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|