Announcement

Collapse
No announcement yet.

Using PB DDT for GUI in a Cobol-program.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using PB DDT for GUI in a Cobol-program.

    I have a lot of Cobol-programs with about 500 DOS-screens. These screens shall be converted to GUI. I wonder if I can use PB DDT for this. One DLL for each screen, witch is possible. But…… I want that the calling program to receive control for each time the user click on a button, enter a field, leave a field etc. In other words each CALLBACK FUNCTION shall leave the control back to the calling Cobol-program and after that the Cobol program has done its work, the control is transferred back to the CALLBACK FUNCTION.

    Is this possible?? And how to do it??
    Fim Wästberg

  • #2
    Why not convert the entire cobol program to pbwin.

    The 'screens' do not need to be each a separate program. Seems to me you could do it with threads or just calling up separate dialogs or repainting the same dialog or window for each screen. Of course I don't know the inner workings of your cobol program but I would think most anything could be done
    with PB either with an API or some sort of workaround if necessary.
    Client Writeup for the CPA

    buffs.proboards2.com

    Links Page

    Comment


    • #3
      Is it possible? Yes.

      How is it done?

      Three ways I can think of..

      1. In your DDT CALLBACK function in the DLL, you call an ENTRY in your COBOL program which you have passed to the dialog creation function in the DLL as a parameter (Use ADDRESS OF (entry name) operator on your COBOL program to get the address to pass, and CALL DWORD from your DLL-based procedures). If your cobol compiler does not provide the ADDRESS OF operator for use with entry names, just pass the entry name as a parameter and get the address with GetProcAddress (Entry names are EXPORTed).

      2. You subclass the controls, directing flow to an address in your COBOL module.

      3. You create a window procedure in your COBOL module and SetParent() of all the controls to a handle to that window. This one is probably more work than it's worth, since anything you want to do in the COBOL module's window procedure will have to be done with "Pure" SDK calls, unless you have one of them new-fangled cobol compilers supporting OO syntax for window creation.

      MCM
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment

      Working...
      X