4

Is it possible to create XBAP applications in Powerbuilder 12 ? I learned that powerbuilder 12 supports WPF but im not sure about WPF Browser (XBAP) Apps.

Any help or link is appreciated.

Thanks!

Jojo Sardez
  • 8,400
  • 3
  • 27
  • 38

2 Answers2

3

So, since it's not released yet, nothing's official, but from what I've heard of the announcements, that's not the intention in this release. Mind you, it wasn't intended in previous releases to support .NET controls but people like Bruce Armstrong found creative ways to do it anyway.

The announced intention is to look at a new web solution post-PB12 (PB12 is pretty massive already), but it's not 100% clear if they'll settle on XBAP, which is a logical extension from their WPF work, or something else like HTML5.

Good luck,

Terry.

Terry
  • 6,160
  • 17
  • 16
0

No, but you can transform a WPF Windows Application target into XBAP manually. I followed these steps to publish a classic PB app as XBAP app and it worked, but the application was very simple; don't know if it'ill work for you.

  1. PB12.NET generates .csproj files that Visual Studio can't read because they are UTF-16 and lack BOM. You can fix this by opening them in notepad and saving.

  2. Then you need to convert the project from WPF Window App to a WPF Browser App. This can be done following this tutorial: http://www.charlespetzold.com/blog/2006/11/120718.html

  3. PB generates a PBApplicationEntryPoint.cs file containing the Main function (the application entry point). Main calls the instance method PBSession.RunWPFApp, which calls instance method System.Windows.Application.Run(), but this is forbidden in XBAP apps. I don't know what RunWPFApp() does exactly, but PresentationHost (the program that executes the XBAP in client's machine) may be able to start the application if you remove this call and call the PBApplication .create() and .open() methods, this way:

    Remove:
    session.RunWPFApp();
    Add:
    c__a_your_application_name.GetCurrentApplication().create(); c__a_your_application_name.GetCurrentApplication().open("");

  4. For some reason that I don't know, opening any window after closing a window will raise an exception and the program will be terminated. The solution I have found is to use MDI (in PB12.NET MDI is visually equal to TDI) and open windows as tabs using OpenSheet(WithParm).

  5. The PB12.NET runtime relies on some native libraries (i.e.) umanaged code, so the app must be given full trust to use these libs. This tutorial shows how to deploy a full trust XBAP (worked for me): http://blogs.microsoft.co.il/blogs/maxim/archive/2008/03/05/wpf-xbap-as-full-trust-application.aspx

  6. The client machine must have PB12.NET Runtime Package installed and .NET 3.5 SP1.

Sybase is more interested in supporting Silverlight than XBAP, so we'll probably never see a XBAP deploy feature officially suported.

Good luck.

Community
  • 1
  • 1
ygormutti
  • 358
  • 3
  • 17
  • I've followed pretty much the same approach. However, I didn't run into 3 as an issue. Are you indicating you changed the C# code that PB generated there? Also, with regard to 6, I simply included the PB12.Net runtime in the deploy manifest for the XBAP, so they did not need to be installed on the client. It just took a real long time for the initial download. The main issue I ran into was that PB launches the app outside of the browser because the main window class was Window rather than Page. I tried changing it to Page, but then PB12 wouldn't generate the EXE correctly. – Bruce Armstrong Apr 01 '11 at 16:59
  • 3: Yes, I've changed generated code. 6: Good! I though that only .NET assemblies could be included in the deploy manifest. Opening the app in a separate Window wasn't an issue. – ygormutti May 30 '11 at 13:55