Highlighted
Absent Member.
Absent Member.
2246 views

How to refresh MF dialog obj from a program?

Jump to solution

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

 

Linden Rowland - IT Consultant
Owner/Developer, www.SchoolReportWriter.com
IT Consultant to Tindle Newspaper Group

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution
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

Best Regards

Bernd Riemke

View solution in original post

0 Likes
10 Replies
Highlighted
Absent Member.
Absent Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution
You can use e.g

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

in COBOL direct...

Best Regards

Bernd Riemke

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution

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

Linden Rowland - IT Consultant
Owner/Developer, www.SchoolReportWriter.com
IT Consultant to Tindle Newspaper Group

0 Likes
Highlighted
New Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution
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
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution
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

Best Regards

Bernd Riemke

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution

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.

Linden Rowland - IT Consultant
Owner/Developer, www.SchoolReportWriter.com
IT Consultant to Tindle Newspaper Group

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution
I send you a very small sample there you can see how it works 🙂

Best Regards

Bernd Riemke

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution
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

Linden Rowland - IT Consultant
Owner/Developer, www.SchoolReportWriter.com
IT Consultant to Tindle Newspaper Group

0 Likes
Highlighted
New Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution
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
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution
Hi Neil,

I have worked for Micro Focus as a team leader for training and Consulting .
So I know about the depths and heights of Cobol and compilers.
I have founded my own company and offer examples and documents from the practice, no matter where you want to go. Whether C # / VB / WinForms / WFP / WebForms / Azur / ...
The examples I build according to customer requests / wishes as these are needed in practice and not all "TicTac" ...
Yes, the companies react mostly with horror when you hear cobol although these do not at all know what everything with cobol is running!
Without cobol the world would have a very big problem!
This would have to be carried into the world by MicroFocus ...
For example, COBOL / VB a Cobol program from the 80s still runs exactly like it did then ... with VB, a reengeniering had to take place in the meantime ...

Best Regards

Bernd Riemke

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: How to refresh MF dialog obj from a program?

Jump to solution
Hi Neil,
Thanks very much for your detailed reply. I really appreciate your input. I'm freelance and use to work for MF support many many years ago! The cobol system is in-house for my client though used at many sites. Like yours there's a 30 year history! We switched to dialog a decade or so ago and I didn't have time to work out how to do everything plus OO was new to me. Currently doing a big redevelopment and i wanted to rationalise. I'm using the latest visual studio and visual cobol in windows. The debug facilities are really good but really hindered by complex dialog with events flying off all over the place (you know what i mean i'm sure). Ideally we'll move away from dialog but meanwhile i just want to get control over it all from programs. In an ideal world I'd have absolute minimum dialog code itself. Also I hate doing things by rote and so really wanted to understand how it all works behind the scenes e.g. with dialog listview objects and the like, so that i can properly centralise db/dialog-interface/error-trapping etc rather than have it hard-coded all over the place as tends to be the result of thirty years of development!
Getting the dialog into the progs is the last piece of the gaining-control jigsaw for now. I'm also switching from MF files to MySQL so again have better control over the data. MF indexed files are superfast but like dialog, a mare to debug.
All the best to you anyway,
Regards,
Linden

Linden Rowland - IT Consultant
Owner/Developer, www.SchoolReportWriter.com
IT Consultant to Tindle Newspaper Group

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.