|
-
Nov 3rd, 2001, 03:52 AM
#1
Createdirectiory
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
-
Nov 3rd, 2001, 07:57 AM
#2
Conquistador
AS I put in your thread in General VB
Why not use MkDir
anyway answering ur question:
VB Code:
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
-
Nov 3rd, 2001, 11:26 AM
#3
da_silvy, since we're not really using SECURITY_ATTRIBUTES structure, you can shorten you code to this:
VB Code:
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
-
Nov 3rd, 2001, 11:57 AM
#4
Conquistador
Cool,
Where can i find out more about the API and it's functions?
-
Nov 5th, 2001, 01:10 PM
#5
-
Nov 5th, 2001, 01:50 PM
#6
Black Cat
And MSDN is the best, but it's not aimed at VB.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Nov 6th, 2001, 12:07 AM
#7
Conquistador
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|