Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

mf net express cobol and winapi
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


Report this thread to moderator Post Follow-up to this message
Old Post
wolfgang.adamec@gmail.com
03-11-06 08:55 AM


Re: mf net express cobol and winapi
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

Report this thread to moderator Post Follow-up to this message
Old Post
James J. Gavan
03-11-06 11:55 PM


Re: mf net express cobol and winapi
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.


Report this thread to moderator Post Follow-up to this message
Old Post
Kellie Fitton
03-11-06 11:55 PM


Re: mf net express cobol and winapi
Hello Jimmy!
Thank you for your advice.
Wolfgang


Report this thread to moderator Post Follow-up to this message
Old Post
wolfgang.adamec@gmail.com
03-12-06 08:55 AM


Re: mf net express cobol and winapi
please use either
by value wdirptr
or
by reference wdirname


Report this thread to moderator Post Follow-up to this message
Old Post
Harald.Cordes@microfocus.com
03-13-06 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:17 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.