Re: CreateDirectory fails but GetLastError says succeeded




"alpine" <alpine_don'tsendspam@xxxxxxxx> wrote in message
news:o6sug1hvcq2sqpe4dakupbtte0m44lu4ii@xxxxxxxxxx
> In most cases, you cannot use GetLastError from VB because VB calls
> this function after each API call it makes which clears the error for
> subsequent calls to the function. To get the error info you are
> looking for, use the LastDLLError property of the Err object.
>
> HTH,
> Bryan

Thanks for that clarification.
I'll give it a try
Thanks
mark


.



Relevant Pages

  • Re: Do windows services have to run under an administrative accoun
    ... If I put GetLastError as the first code line on the ... Like William said, ... You call an API and the API returns nonzero in case of succcess and ...
    (microsoft.public.win32.programmer.kernel)
  • Re: CreateDirectory fails but GetLastError says succeeded
    ... Microsoft MVP-Visual Basic Fear and Loathing in LasVegas ... you cannot use GetLastError from VB because VB calls ... To get the error info you are ... >What happens is that the VB runtime is itself using API calls all the ...
    (microsoft.public.vb.winapi)
  • Re: Pinvoke and Win32 level API permissions
    ... You should not call GetLastError when using PInvoke, ... | call to the HrESEBackupPreparefunction in the Exchange backup API. ...
    (microsoft.public.dotnet.framework)
  • Re: GetLastError vs GetLastWin32Error
    ... If I use the Win32 API GetLastError() it returns ERROR_ACCESS_DENIED, but if I use the .NET Marshall.GetLastWin32Errorit returns ERROR_IO_PENDING. ... To get around this Marshal.GetLastWin32Errorhas been provided: the marshalling code saves the value of GetLastError immediately after it makes a call to the actual API so that your code is free to look at the error returned without worrying about those uncontrollable calls the CLR is making. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: terminal emulator & the cursor
    ... calling GetLastError directly. ... returned by the last API your code called ("your" means not written by you, ... that's why type libraries are preferred (they rely on Windows to load ... many Windows API functions. ...
    (microsoft.public.win32.programmer.ui)

Loading