26
Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Embed Size (px)

Citation preview

Page 1: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Sponsored byPowered by

Moving at the Speed of Change May 2015

Charlotte PowerBuilder Conference

Using PowerBuilder Nonvisual Assemblies In VS.Net

Page 2: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Development lead with Integrated Data Services for last 11 years

Previously spent 15 years as an independent PowerBuilder consultant

Have been using PowerBuilder since version 1.0.B

Bruce Armstrong

Page 3: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Charter member of TeamSybase (formerly TeamPS), a PowerBuilder MVP and an SAP Mentor.

Contributing author to SYS-CON's PowerBuilder 4.0 Secrets of the Masters and an editor of SAMs' PowerBuilder 9: Advanced Client/Server Development

Bruce Armstrong

Page 4: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Contributed numerous articles to the PowerBuilder Developer's Journal (PBDJ) and the ISUG Tech Journal

Editor-in-chief of PBDJ from 2004 to 2013

At one point, a technical editor for the ISUG Tech Journal

Bruce Armstrong

Page 5: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

AGENDA

• Generating .Net Assemblies with Classic PowerBuilder • Generating .Net Assemblies with PowerBuilder.Net • Using Powerbuilder Generated .Net Assemblies in Visual

Studio.Net

Page 6: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

GENERATING .NET ASSEMBLIES USING POWERBUILDER CLASSIC

Page 7: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

New Target -> .NET Assembly

Page 8: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Start from scratch or use existing files

Page 9: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

For a new target, specify the nonvisual class to create

Page 10: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Indicating the namespace for the assembly and the assembly name

Page 11: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Selecting methods to expose and giving them .Net friendly names

Page 12: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Signing an assembly to give it a strong name

Page 13: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

GENERATING .NET ASSEMBLIES USING POWERBUILDER.NET

Page 14: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

New Target -> .Net Assembly

Page 15: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Specify the class to use to create the assembly

Page 16: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

USING POWERBUILDER GENERATED .NET ASSEMBLIES IN VS.NET

Page 17: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Add Reference

Page 18: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Navigate to location of assembly

Page 19: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

ADD RUNTIME LIBRARIES

atl71.dllmsvcp71.dllmsvcr71.dllSybase.PowerBuilder.Common.dllSybase.PowerBuilder.Core.dllSybase.PowerBuilder.DataWindow.Interop.dllSybase.PowerBuilder.DataWindow.Win.dllSybase.PowerBuilder.Win.dllSybase.PowerBuilder.WinWebDataWindowCommon.dll

Page 20: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

ADD CODE TO USE ASSEMBLY

private void button1_Click(object sender, EventArgs e) { TeamSybase.ClassicAssembly ca = new

TeamSybase.ClassicAssembly(); ca.HelloWorld(); }

Page 21: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

CHANGE CLIENT PROFIE TO .NET FRAMEWORK 4

It usually defaults to .Net Framework 4 Client Profile, which doesn’t contain all the references that the PowerBuilder assembly needs

Page 22: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

AND RUN THE CODE

Page 23: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

• All of my PowerBuilder samples, including the source code for the demos I've done at various conferences are available in the PowerBuilder Samples folder on my Google Drive: http://goo.gl/VXouQ

• The PowerBuilder Developer's Journal may have gone away, but I'm going a free "magazine" on FlipBoard. It's basically just collection of articles from all over the internet on PowerBuilder: http://goo.gl/Mrd3Ql

• I've done a number of videos for the SAP Database and Technology Academy. The PowerBuilder related videos, including mine, are available at:http://goo.gl/53pe7a

SOME LINKS

Page 24: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

• I've done a number of webinars for PowerBuilder.TV. The archives of the webinars related to PowerBuilder, including mine, are available at: http://goo.gl/IUHN1N

• Also, don't forget the PowerBuilder Developer Center, where a bunch of us hang out to answer questions, write blogs and documents: http://goo.gl/DtaS58

• You might also want to check out the PowerBuilder Central site. It's an attempt to collect references to different resources like this and make the available in a central location: http://goo.gl/WVyNo7

SOME LINKS

Page 25: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

• If you're looking for PowerBuilder training, be sure to check out Yakov Werde's training offerings (as well as his consulting services) at: elearnitonline.com

SOME LINKS

Page 26: Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using PowerBuilder Nonvisual Assemblies In VS.Net

Charlotte PowerBuilder ConferenceMoving at the Speed of Change May 2015

Questions and Answers