Skip to main content

[Migrated content. Thread originally posted on 17 January 2006]

Hello Everyone,
has anyone an example of using WinAPI to check existence and create/rename folder?
thanks in Advance, Giovanni

[Migrated content. Thread originally posted on 17 January 2006]

Hello Everyone,
has anyone an example of using WinAPI to check existence and create/rename folder?
thanks in Advance, Giovanni

77 mydir pic x(1024).
77 secflags pic x(4) comp-n.
...
PROCEDURE DIVISION
           CALL    "KERNEL32.DLL@WINAPI".
           STRING "C:\\SomeDir" LOW-VALUES DELIMITED BY SIZE
                       INTO mydir.
           MOVE   0 TO secflags.
           CALL    "CreateDirectoryA" USING
                       BY REFERENCE mydir
                       BY VALUE secflags.
           CANCEL "KERNEL32.DLL".

[Migrated content. Thread originally posted on 17 January 2006]

Hello Everyone,
has anyone an example of using WinAPI to check existence and create/rename folder?
thanks in Advance, Giovanni

77 mydir pic x(1024).
77 secflags pic x(4) comp-n.
...
PROCEDURE DIVISION
           CALL    "KERNEL32.DLL@WINAPI".
           STRING "C:\\SomeDir" LOW-VALUES DELIMITED BY SIZE
                       INTO mydir.
           MOVE   0 TO secflags.
           CALL    "CreateDirectoryA" USING
                       BY REFERENCE mydir
                       BY VALUE secflags.
           CANCEL "KERNEL32.DLL".

[Migrated content. Thread originally posted on 17 January 2006]

Hello Everyone,
has anyone an example of using WinAPI to check existence and create/rename folder?
thanks in Advance, Giovanni
Hi Gisle,
thankU for suggestion, I'd already solved in an look-alike manner:
*
01 security-attributes.
02 dwNLenght pic x(4) comp-x.
02 lpSecurityDescriptor pic x(8) comp-x.
02 bInheritHandle pic x(1) comp-x.
77 actual-folder-name pic x(256).
77 return-value signed-int.
*
...
call "kernel32.dll@__stdcall"
initialize security-attributes
call "@[DISPLAY]:CreateDirectoryA"
using by reference actual-file-name,
by reference security-attributes
giving return-value
if return-value is equal to -1 then
perform error_proc
cancel "kernel32.dll@__stdcall"
exit paragraph
end-if

however thankU so much! Giovanni