Window, the long and short of it... 
Author Message
 Window, the long and short of it...

As a last gasp of defiance, I am trying to write my assignments for a
Windows Programming class using Micro Focus COBOL.

(Foothill College, CIS 54A, Intro to Windows Programming,
Los Altos, California...
Everybody else is using C or C++...

So far the results have been gratifying, but I'd thought I'd share
something That happened to me.

I needed to use the constant WS_OVERLAPPEDWINDOW as a windows style
but I didn't know how to translate it.  Well, what I went thru was
amusing.  I guess I have been involved in OOPs programmin' for decades.
(as in OOPS!!, there goes the abend...)

Well I wimped out and resorted to using Microsoft Visual C++ to use
the de{*filter*} in a C version of my program.  I MOVED the value
WS_OVERLAPPEDWINDOW to an int i that I had defined. i.e.
  int i = WS_OVERLAPPEDWINDOW;
Guess what?  It contained 0000.  But theres more...
I finally reallized that windows styles are long integers,
which have a picture PIC S9(8) COMP-5 versus PIC S9(4) COMP-5.
So, I changed the int to a long, so I good get along with windows.

I found that the long contained 0CF00000 which I plugged into the COBOL
program as:
78  WS-OVERLAPPEDWINDOW  h"0CF00000".

By the way, it turns out the WS_OVERLAPPED is hex zeroes....
Low-values are endemic in C programmin' (tee hee)
I exist to Pun, and cobol code.  Lowest form of humor meets it's match...
And THEN it worked.
And that's the long and short of it (short = int on IBM PC) tee hee
har, har har....

Chris Mason
"The Unknown COBOL Programmer"
The opinions expressed are mine, not my Employers.

LMSC5:  Tons of Beautiful Big Blue Iron...



Sun, 12 Oct 1997 03:00:00 GMT  
 Window, the long and short of it...


Quote:

>As a last gasp of defiance, I am trying to write my assignments for a
>Windows Programming class using Micro Focus COBOL.

>Well I wimped out and resorted to using Microsoft Visual C++ to use
>the de{*filter*} in a C version of my program.  I MOVED the value
>WS_OVERLAPPEDWINDOW to an int i that I had defined. i.e.
>  int i = WS_OVERLAPPEDWINDOW;
>Guess what?  It contained 0000.  But theres more...
>I finally reallized that windows styles are long integers,
>which have a picture PIC S9(8) COMP-5 versus PIC S9(4) COMP-5.
>So, I changed the int to a long, so I good get along with windows.

>I found that the long contained 0CF00000 which I plugged into the COBOL
>program as:
>78  WS-OVERLAPPEDWINDOW  h"0CF00000".

Chris, obviously you have the windows C include files which should
contain these values anyway. What you seem not to be aware of is the
H2CPY utility shipped with MF COBOL. It converts the C .h files into
COBOL copy files creating all the 78's for you. If you hadn't spotted
this by now you'll probably hate me for telling you. ;-)

SPLIT78 is the other useful tool for converting .h files too.

Then all you do is add a COPY "WIN.CPY" or whatever in your program. It
adds a bit to your compile time but not to your resulting .OBJ.

Shaun.



Mon, 27 Oct 1997 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. long = short*short ; (short,short) = long/short

2. long-to-short dir/filenames

3. CONTRACTS: CLIPPER/Long & Short/Md,Oh,Mi

4. (long) Re: Including ALL Programming Ideas (short)

5. Long name to short name conversion

6. Converting short to long

7. Seeking short or long term contract position(s)

8. NWFL-Employment-Embedded Ada Programmers for Short/Long Term Projects

9. Experienced cobol developers seek short/medium/long term contracts

10. COBOL/Mainframe/100 Contracrs-Long & Short Term

11. creating short excerpts of long texts

12. win32api -- long vs short filenames

 

 
Powered by phpBB® Forum Software