Click to See Complete Forum and Search --> : Createdirectiory
Blacknight
Nov 3rd, 2001, 02:52 AM
I found this one in the api veiwer tool.
It requirs :
1.pathname-easy
2.SECURITY_ATTRIBUTES
what do i write in the second one?
Public Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type
da_silvy
Nov 3rd, 2001, 06:57 AM
AS I put in your thread in General VB
Why not use MkDir
anyway answering ur question:
Private Declare Function CreateDirectory Lib "kernel32.dll" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type
Private Sub Form_Load()
Dim secAttr As SECURITY_ATTRIBUTES ' security attributes structure
Dim retval As Long ' return value
secAttr.nLength = Len(secAttr) ' size of the structure
secAttr.lpSecurityDescriptor = 0 ' default (normal) level of security
secAttr.bInheritHandle = 1 ' this is the default setting
' Create the directory.
retval = CreateDirectory("C:\NewDir", secAttr)
End Sub
Megatron
Nov 3rd, 2001, 10:26 AM
da_silvy, since we're not really using SECURITY_ATTRIBUTES structure, you can shorten you code to this:
Private Declare Function CreateDirectory Lib "kernel32.dll" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As Any) As Long
Private Sub Command1_Click()
CreateDirectory "C:\NewDir", 0
End Sub
da_silvy
Nov 3rd, 2001, 10:57 AM
Cool,
Where can i find out more about the API and it's functions?
Hack
Nov 5th, 2001, 12:10 PM
Look on http://www.allapi.net/ or http://www.vbapi.com/ref/funca.html
JoshT
Nov 5th, 2001, 12:50 PM
And MSDN is the best, but it's not aimed at VB.
da_silvy
Nov 5th, 2001, 11:07 PM
I know those sites,
That's where i got the ^^^ above example.
I wanted sites which cut to the chase
etc.
MSDN is good, if you can work out how to put C++ in VB :rolleyes:
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.