
CreateFile API Return INVALID_HANDLE_VALUE
Ditto, Mattias; must be user error.
If you got the declare from the API Viewer then it includes the
SECURITY_ATTRIBUTES parameter, which must be supplied with live data, or you
can change it to As Long or As Any and pass it 'ByVal 0&'.
Also, check err.LastDllError, is it 87?
-----------------------------------
Monte Hansen
http://KillerVB.com
Please respond to the newsgroups
-----------------------------------
Quote:
> Hi,
> I am trying to use this API, and no matter what I do, it always returns
> -1 or INVALID_HANDLE_VALUE.
> All I need is a handle to a file, so I can read its attributes, such
> size an so on. I use the OPEN_EXISTING flag.
> Does anyone have had any problems with this function?
> VB6, OS=WIN98
> Ernesto