views:

60

answers:

2

I have control designed for VS2008 and VS2010. Will it work in Power Builder 12 designer as well? or Would I need to create any design.dll

+2  A: 

Hello,

It depends on the control but in general PowerBuilder 12 (and prior versions) can use external controls via OLE without any problem. You add them to your application via Insert --> Control --> OLE menu item, then you'll be prompted with a list of registered object to select from.

When coding you'll need to use the "object reference" or dot notation to reference properties and/or methods. Everything works fine in PB but it's not as user friendly you can't do named arguments and need to get your syntax just (and catch exceptions) right to avoid null object reference crashes.

Hope that I understood your question correctly and this helps.

Regards, Rich

DisplacedGuy
Thanks Rich. Normally, while developing a control in we'll ship control's design dll and visual studio design dll. For expression we'll ship expression design dll. What kind of assembly should i create to make the control editable easily in the PowerBuilder's designer surface?
Avatar
Hi - Normally when using custom external controls in PowerBuilder you have to create an instance of the control and modify it at runtime. Also, a limitation of using PowerBuilder to do OLE Automation is that PowerScript does not have the equivalent of Visual Basic's "WithEvents" statement, which allows that development tool to trap events raised by the automation objects. There are way to overcome some of these limitations but you need to use a PBNI extension which I have not used myself. You could check some examples using PBNI here: http://www.sybase.com/detail?id=1058501#245
DisplacedGuy
@DisplacedGuy Thanks a lot for the link.
Avatar
A: 

what version of PowerBuilder are you targetting? If its a .Net control and you are targetting PB.Net, its based on the visual studio shell and will work fine with what you've done for Visual Studio.

Bruce Armstrong
Avatar