Re: CreateProcess Fails With No Error
- From: Sinna <news4sinna_NOSPAM@xxxxxxxxxx>
- Date: Wed, 15 Jun 2005 16:42:04 +0200
Steve Cooper wrote:
That got me a little further on - Err.LastDllError returns 3, but I have yet to work out what that means!
Steve
Err.LastDllError returns the Win32 Error last occurred.
Underneath you can find some source code to get a readable discription:
---
Private Declare Function FormatMessage Lib "kernel32" Alias _ "FormatMessageA" ( _ ByVal dwFlags As Long, lpSource As Any, ByVal dwMessageId As Long, _ ByVal dwLanguageId As Long, ByVal lpBuffer As String, _ ByVal nSize As Long, Arguments As Long) As Long
Private Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000 Private Const FORMAT_MESSAGE_IGNORE_INSERTS = &H200 Private Const FORMAT_MESSAGE_MAX_WIDTH_MASK = &HFF
Public Function GetWin32ErrorDescription( _
ByVal ErrorCode As Long) As String
On Error GoTo Finish Dim sError As String * 2048
Dim sText As String
Dim RetVal As Long RetVal = FormatMessage( _
FORMAT_MESSAGE_FROM_SYSTEM Or _
FORMAT_MESSAGE_IGNORE_INSERTS Or _
FORMAT_MESSAGE_MAX_WIDTH_MASK, _
ByVal 0&, ErrorCode, 0, sError, Len(sError), 0)If RetVal > 0 Then sText = Left(sError, RetVal)
Finish:
GetWin32ErrorDescription = sText
End Function
---
Sinna .
- Follow-Ups:
- Re: CreateProcess Fails With No Error
- From: Steve Cooper
- Re: CreateProcess Fails With No Error
- References:
- CreateProcess Fails With No Error
- From: Steve Cooper
- Re: CreateProcess Fails With No Error
- From: Sinna
- Re: CreateProcess Fails With No Error
- From: Steve Cooper
- CreateProcess Fails With No Error
- Prev by Date: Re: CreateProcess Fails With No Error
- Next by Date: Re: CreateProcess Fails With No Error
- Previous by thread: Re: CreateProcess Fails With No Error
- Next by thread: Re: CreateProcess Fails With No Error
- Index(es):
Relevant Pages
|