How to refresh MF dialog obj from a program?

Hi there,

Is there an MF dialog GUI method to refresh an object only i.e. not set focus on it?

For example to enable an object i just do this. Is there a refresh equivalent method?

CALL 'GUI-enable' using my-dialog-object-handle. 

GUI.cbl ---------------------------------------------------------------------------------

$set mfoo
class-control.
AbstractWindow is class "awindow".

working-storage section.
01 obj object reference value null.

linkage section.
01 hand pic x(4) comp-5.

procedure division.

entry 'GUI-enable' using hand.
    *> enable object from handle...
     invoke abstractWindow "fromHandle" using hand returning obj.
     invoke obj "enable".
     invoke obj "destroyproxy" returning obj.
     goback.

Many thanks,

Linden

 

  • You can use e.g

    REFRESH-OBJECT WIN-ARTIKELVERWALTUNG
    SET-FOCUS EF-ARTNR

    in COBOL direct...
  • Thank you for your reply Bernd.

    Not directly in a COBOL program? I'm using Visual COBOL 2.32 on a Windows 10 machine. In the MF Dialog code you mean? I'm trying to avoid dialog and keep control in the COBOL source which is more flexible and easier to debug.

    Regards,

    Linden

  • You can control a lot of controls in the dialog system by either using win api's or the GUI class library.

    You must remember at some stage you might want to move to a 64 bit client interface, so perhaps before you go to far down this road you might want to consider what you want to do in the future. The dialog system is really an end of life product.

    If you have currently got all your code in dialog system, you can write a program to parse the contents to migrate it to a new system, plus there are other migration solutions (Ask Micro Focus).

    So have you thought ahead?
    Look at the GUI class library.

    Neil
  • Verified Answer

    Yes directly in a Cobol Program!

    see the "DSLANG.CPY"...

    You can use the most DS Syntax direct in a Cobol program!


    Best Regards

    Bernd
  • Verified Answer

    Yes directly in a Cobol Program!

    see the "DSLANG.CPY"...

    You can use the most DS Syntax direct in a Cobol program!


    Best Regards

    Bernd
  • Hi Neil, thanks for your reply. Are you an MF employee out of interest? For now I don't have time to move away from dialog but understand it's old hat. I've been using the GUI library as per the example in my original post but I can't see how to refresh an object. Do you know which GUI class/method can do this for me. Linden

    Hi Bernd, do you have a working example that compiles and runs in Visual COBOL? Thanks, Linden.

  • I send you a very small sample there you can see how it works :-)
  • Thanks BERND for your help. I'm using the MF std "dslang.cpy" and it's working great . Very happy I can stop using actual dialog and control things from the programs.
    NEIL, getting the dialog control into the programs feels like a useful stepping stone away from dialog. I hope to do as you suggest at some point and move to WIN FORMS I guess you mean?
    Linden
  • Thanks BERND for your help. I'm using the MF std "dslang.cpy" and it's working great . Very happy I can stop using actual dialog and control things from the programs.
    NEIL, getting the dialog control into the programs feels like a useful stepping stone away from dialog. I hope to do as you suggest at some point and move to WIN FORMS I guess you mean?
    Linden
  • Hi Linden,

    Glad you have least come right and got something working.

    I don't work for Micro Focus, but I tend to find myself on the bleeding edge of technology and asking Micro Focus to come to the party and enhance product or help in something we might be doing.

    Win forms was not on my list at all. For lots of COBOL software houses the thought of bringing their applications into the current day can often seem like a daunting task and depending on how deeply they have coded around certain technologies like the dialog system can make life much harder. For example a huge majority of our dialog is controlled using native code and win api's - lots of our programs we exceeded the number of objects allowed in dialog, or we wanted to employ some 3rd party controls - this is a rewrite of the whole interface.

    Demand from our customers say "We want your application in the cloud" or "we want a web front end" and "can we use your application on a mobile device?". um and "What about bots?" ........we actually do all of these things.

    But if you look at your own application have you got a future path or road map of getting there?
    Are you still on Net Express or have you moved to Visual COBOL?

    Converting raw dialog system is not to bad, Micro Focus can help you with vendors that perhaps have tools to help you, but often rewriting the interface has no direct benefit for the customer and you could spend 5 years doing it instead of adding better or new functionality into your product.

    Obviously this is all dependent of the type of application you have, is it in-house or if you sell in on and the platforms you support.

    I think for all of us, these are exciting times, Azure PAAS (Platform as a service), where installing software doesn't happen, instead you publish your COBOL code as a service. Now you need an interface for the consumer - what are you going to use? Do you have to think about IoT (Internet of Things)?

    Today we still can use COBOL code written 30 years ago on Azure!!!! Fantastic - well done Micro Focus.

    But in 30 years the demand from consumers on how they use the product has change dramatically. We have gone from green screens, to dialog system, people using the old brick (Huge battery) style cell phones to iPhones or Android phones, tablets, other integrated devices.....and now we have VR and Microsoft Hololens as input devices or for visual feed back.

    How about using the Amazon dot for your product? - it's ALL doable as well as fun to do.

    We now have 64 bit operating systems......what are you going to do when Microsoft stop support for 32 bit? (Dialog system is 32 bit only). - Yes, it's not going to happen overnight but will you be ready and what's the cost?

    All I say is think about the road ahead :)

    Neil