Re: CreateProcess Fails With No Error

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
.



Relevant Pages

  • Re: Run Time Error 3075 Missing Operator
    ... Dim selector As String ... Dim sText As String ... this form and the others is that the code references a query whereas ...
    (comp.databases.ms-access)
  • Re: Search and Replace parameter too long?
    ... Dim rText As String ... Dim sText As String ...
    (microsoft.public.word.vba.general)
  • Re: Feste Stringlänge
    ... Dim sText as String * 80 ... Versuch mal folgendes ... ... Dim sText As New VB6.FixedLengthString ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Re: how do u send an email using access?
    ... Like I said, it is designed for Outlook-assumed clients, but otherweise ... ByVal lpOperation As String, ... Dim stext As String ... Call ShellExecute(hwnd, "open", stext, vbNullString, vbNullString, ...
    (comp.databases.ms-access)
  • Re: E-Mail
    ... Public Declare Function ShellExecute Lib "shell32.dll" ... ByVal lpOperation As String, ... Dim stext As String ... Call ShellExecute(hwnd, "open", stext, vbNullString, vbNullString, ...
    (microsoft.public.access.forms)