
CreateFile - API, Am I a Pudding?
What is err.lastdllerror? Does that file already exist?
Maybe change create_new to create_always
--
Richard Cardarelle, MCP
Eclipse Applications
www.eclipseapplications.com
I can't seem to create a file with the API CreateFile. However I can
with the less flexible API lcreate.
Any suggestions
Thanks, Jon
Private Sub Command2_Click()
Dim secu As SECURITY_ATTRIBUTES
FileName$ = "c:\test1.txt"
handt& = CreateFile(FileName, GENERIC_READ Or GENERIC_WRITE, 0, secu,
CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0)
'handt returns value of -1
handt& = lcreat(FileName, 0)
'handt returns valid handle number eg. 280
End Sub