| Author |
mf net express cobol and winapi
|
|
| wolfgang.adamec@gmail.com 2006-03-11, 3:55 am |
| Net Express Cobol and WINAPI
Hello!
I use Net Express Cobol 4. I have already made some mf net expr. cobol
programs using WINAPI that work, but I have problems with the following
piece of code:
IDENTIFICATION DIVISION.
PROGRAM-ID. cobolwinapi.
ENVIRONMENT DIVISION.
SPECIAL-NAMES.
call-convention 74 is WINAPI.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 uint is typedef pic 9(SZ) comp-5.
01 ulong is typedef pic 9(9) comp-5.
01 DWORD is typedef ulong.
01 wdirname pic x(256).
01 wdirptr pointer.
01 wsize uint.
01 wret dword.
PROCEDURE DIVISION.
Main-Process SECTION.
call "cob32api". *> for int and gnt progs
move spaces to wdirname
move 256 to wsize
set wdirptr to address of wdirname
call "GetCurrentDirectoryA" using by value wsize
by reference wdirptr
returning wret.
After the call the value of wret is correct - 4 (for "N:\i"), but there
is no value in wdirname.
Does anybody know a solution for this?
Thanks in advance
Wolfgang
| |
| James J. Gavan 2006-03-11, 6:55 pm |
| wolfgang.adamec@gmail.com wrote:
> Net Express Cobol and WINAPI
Wolfgang,
I don't do APIs. Possibly one of the M/F lurkers will jump in and give
you an answer, or somebody else who is familiar with API calls. Are you
aware that going to microfocus.com you can sign-up for free and register
questions, under the heading 'Net Express' on the M/F Forum ?
Jimmy
| |
| Kellie Fitton 2006-03-11, 6:55 pm |
| Hi,
You need to use the alias of the calling convention, case in point:
call WINAPI "GetCurrentDirectoryA" using
by value wSize size 4
by reference wDirPtr
returning wRet
end-call
http://msdn.microsoft.com/library/d...ntdirectory.asp
Kellie.
| |
| wolfgang.adamec@gmail.com 2006-03-12, 3:55 am |
| Hello Jimmy!
Thank you for your advice.
Wolfgang
| |
| Harald.Cordes@microfocus.com 2006-03-13, 3:55 am |
| please use either
by value wdirptr
or
by reference wdirname
|
|
|
|