Can cobol be framed-up legally?...

From: Kellie Fitton (KELLIEFITTON_at_YAHOO.COM)
Date: 02/09/05


Date: 9 Feb 2005 13:04:20 -0800

Hello Everyone,

when creating a graphical window program -- my window procedure
receives windows's messages such as the following: WM-CREAT,
WM-PAINT, WM-ERASEBKGND, WM-CONTEXTMENU, WM-COMMAND and
WM-DESTROY. So, if I want to handle the message my self, I need
to call an entry-point function and pass parameters such as
lnk-hWnd, lnk-hDC and lnk-hPs which are numeric values. However,
I don't have a Frame-Of-Reference conditions that helps me
determines how to pass these parameters to the entry function.
should I pass these parameters as 'by value' or 'by reference'?
I am using Net Express 3.1 with windows 2000 professional.

your kind help is appreciated. Kellie.

*>--- case in point cobol code -----

linkage section.
01 lnk-hWnd hWnd.
01 lnk-hDC hDC.
01 lnk-hPs hDC.
01 lnk-hDCbitmap HANDLE.

procedure division.
0001-main.

   ...............

entry "MyWndProc" WinAPI using
                  by value lnk-hwnd
                  by value lnk-iMessage
                  by value lnk-wParam
                  by value lnk-lParam.
     move 0 to ls-mResult.
     evaluate lnk-iMessage

     when WM-PAINT
          call winapi "PaintMyWindow" using
                 by reference lnk-hwnd
                 by reference lnk-hDCbitmap
                 by value lnk-hps
              returning return-code
          end-call

      ...............

entry "PaintMyWindow" winapi using
          by reference lnk-hwnd
          by reference lnk-ppaint
          by value lnk-hps.

      ...............

   exit program returning 0.

end program window.



Relevant Pages

  • Re: Getting DM_DRAGOVER messages in dialog windows
    ... Some top-level window procedure tosses them well in advance. ... But this mysterious procedure always seems to get absolute first crack at things, and if it discards something, or handles it, it is invisible to even subclassed window procedures. ... I take it that static window controls don't keep track of this for icons. ... If so, it seems my alternative should have been to just write my own window class which loads and displays the pointer and handles its own presentation parameter changes, sans subclassing. ...
    (comp.os.os2.programmer.misc)
  • Re: Unicode Button in VB6
    ... (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) ... know how to subclass my window to avoid to conversion Unicode -> Ansi. ... You are subclassing a window by replacing the original window procedure ...
    (microsoft.public.vb.winapi)
  • Re: Unicode Button in VB6
    ... "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal ... know how to subclass my window to avoid to conversion Unicode -> Ansi. ... You are subclassing a window by replacing the original window procedure ...
    (microsoft.public.vb.winapi)
  • Re: Message Reflection
    ... When you subclass a window procedure, ... >>> the address of the original window procedure is received as the ... You can choose to remove the subclass when you destroy the ... >>> control for the sake of a slight efficiency gain, ...
    (microsoft.public.win32.programmer.ui)
  • Re: Unicode Button in VB6
    ... know how to subclass my window to avoid to conversion Unicode -> Ansi. ... You are subclassing a window by replacing the original window procedure ... SetWindowLongWbecause the VB standard controls are all of ANSI window ...
    (microsoft.public.vb.winapi)