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

Power Cobol and Windows API Routines
Does anyone have any examples on how to use the Windows API calls with
Fujitsu PowerCobol (6) ?

I want to use some GDI line drawing calls. LineTo etc.

Report this thread to moderator Post Follow-up to this message
Old Post
James Sugrue
11-26-04 08:55 PM


Re: Power Cobol and Windows API Routines
Yes, I have some.

Before you start here are some suggestions:

1. Download a current API reference. (I use API Guide downloadable from:
http://www.allapi.net
2. Find out what part of windows your API call "lives in". (The document in
1 above will tell you this.)
3. Make sure you include the library containing these entry points into your
PowerCOBOL project. Note that Fujitsu do NOT provide a comprehensive set of
libraries. Some must be obtained by getting the Windows SDK.However,
libraries for most of the APIs you will use are provided by Fujitsu.

On checking, I find that the API you have requested is part of windows
GDI32.dll. This means you will need GDI32.lib included in your PowerCOBOL
project.(This is not provided by Fujitsu per se. You will probably need the
Windows SDK - downloadable for free from MS but it is over 100MB).

Here is the prototype in "VB speak":(You will need to "translate" this into
COBOL before using it...)

Declare Function LineTo Lib "gdi32" Alias "LineTo" (ByVal hdc As Long, ByVal
x As Long, ByVal y As Long) As Long

"hdc" is a device context, "x" is the x co-ordinate for the line end, "y" is
the y co-ordinate for the line end.

Check the PowerCOBOL sample code (I think there is an example API call in
it).

When you have some code of your own, post it here if you can't get it to
work. Or send me the PowerCOBOL project privately.


HTH,

Pete.
(top post no more below.)

"James Sugrue" <jamessugrue@xtra.co.nz> wrote in message
news:Kivod.9052$9A.208371@news.xtra.co.nz...
> Does anyone have any examples on how to use the Windows API calls with
> Fujitsu PowerCobol (6) ?
>
> I want to use some GDI line drawing calls. LineTo etc.
>




Report this thread to moderator Post Follow-up to this message
Old Post
Pete Dashwood
11-26-04 08:55 PM


Re: Power Cobol and Windows API Routines
James Sugrue wrote:
> Does anyone have any examples on how to use the Windows API calls with
> Fujitsu PowerCobol (6) ?
>
> I want to use some GDI line drawing calls. LineTo etc.

Second what Pete says - it's pretty easy once you get the hang of it.

Watch out for proper casing - the API routines are positively anal about
that. You'll have to add a compile directive to your form. Double-click the
script to bring up "Properties" and add the following to "Compile" tab /
options:

"ALPHAL(WORD)"  (no quotes)

otherwise calls to subprograms get folded to upper-case.

Here's an example to get the Windows directory:

01  The-Path-Name  PIC X(256).
01  Path-Len  Pic 9(9) Comp-5.

Move 255 To Path-Len
Call 'GetWindowsDirectoryA' With STDCALL Using
By Reference The-Path-Name
By Value Path-Len






Report this thread to moderator Post Follow-up to this message
Old Post
JerryMouse
11-29-04 08:55 PM


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 06:54 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.