Absent Member.
Absent Member.
1619 views

WPF in Visual Cobol

Jump to solution

[Migrated content. Thread originally posted on 12 August 2011]

Hi All,

Just checking with Micro Focus is there any support for creating a WPF Browser Application in Visual Cobol, which I can then create COBOL code behind the various events?

I can create a WPF Browser Application in the Visual Basic Installed templates but doesnt seem to be available in the COBOL templates.

Many thanks

Neil.
0 Likes
1 Solution

Accepted Solutions
Absent Member.
Absent Member.

You can add a Page item to a standard COBOL WPF project, remove the Window1.xaml item, and then edit the app.xaml to point to your Page1.xaml (or whatever you called it). This takes you part of the way there. However, you won't get the .xbap file which enables deployment via a web browser.

To get the .xbap file, inside visual studio, right-click your project file and click Unload project. Then right-click and edit project. You need to add these properties to the first <PropertyGroup>:

<StartAction>URL</StartAction>
<HostInBrowser>true</HostInBrowser>
<BootstrapperEnabled>false</BootstrapperEnabled>
<TargetZone>Internet</TargetZone>
<StartupObject>Main</StartupObject>
<GenerateManifests>true</GenerateManifests>
<SignManifests>True</SignManifests>

I also removed the <Publish> property although I don't know for sure whether that is necessary.

Now when you build, you will get an .xbap file which will download and run your application inside IE. However, the minimal research I've done doesn't tell me whether you will hit problems as soon as the COBOL runtime is required by your application - you may need to add explicit references to it in your project, and of course there is licensing on the target machine to consider. Let us know if this is of any help though, and what it is you want to achieve.


View solution in original post

0 Likes
4 Replies
Absent Member.
Absent Member.

You can add a Page item to a standard COBOL WPF project, remove the Window1.xaml item, and then edit the app.xaml to point to your Page1.xaml (or whatever you called it). This takes you part of the way there. However, you won't get the .xbap file which enables deployment via a web browser.

To get the .xbap file, inside visual studio, right-click your project file and click Unload project. Then right-click and edit project. You need to add these properties to the first <PropertyGroup>:

<StartAction>URL</StartAction>
<HostInBrowser>true</HostInBrowser>
<BootstrapperEnabled>false</BootstrapperEnabled>
<TargetZone>Internet</TargetZone>
<StartupObject>Main</StartupObject>
<GenerateManifests>true</GenerateManifests>
<SignManifests>True</SignManifests>

I also removed the <Publish> property although I don't know for sure whether that is necessary.

Now when you build, you will get an .xbap file which will download and run your application inside IE. However, the minimal research I've done doesn't tell me whether you will hit problems as soon as the COBOL runtime is required by your application - you may need to add explicit references to it in your project, and of course there is licensing on the target machine to consider. Let us know if this is of any help though, and what it is you want to achieve.


View solution in original post

0 Likes
Absent Member.
Absent Member.
Hi Paul,

Many thanks for that info, is there any chance you could post that project so I can download it or email it to me neil@eurorealm.co.uk

Kind regards

Neil.
0 Likes
Absent Member.
Absent Member.
Which computer need the COBOL runtime?
The server with the WPF application?
(Installed in the IIS - am I right)?
Or the client computer, where the application runs in the browser?
0 Likes
Micro Focus Expert
Micro Focus Expert
I think you will need to check to see if this is a supported scenario.

I say this because it is something I have not seen working or even tested and I am sure that the implications on licensing/runtime distribution has not been thought out too (Scot feel free to comment).
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.