PowerBuilder, disable system menu`s close button

ulong ll_parent_hwnd ulong ll_sys_menu_hwnd ulong ll_sys_menu_close_flags ulong ll_ret n_cst_numerical u_num ll_parent_hwnd = Handle(this.parentwindow()) ll_sys_menu_hwnd = GetSystemMenu(ll_parent_hwnd, FALSE) ll_sys_menu_close_flags = GetMenuState(ll_sys_menu_hwnd, SC_CLOSE, MF_BYCOMMAND ) ll_ret = u_num.of_bitwiseand(ll_sys_menu_close_flags , MF_DISABLED) ib_close_prev_enabled = (ll_ret = 0) If ib_close_prev_enabled Then EnableMenuItem (ll_sys_menu_hwnd, SC_CLOSE, MF_BYCOMMAND + MF_DISABLED + MF_GRAYED) End If   And to enable it later: If ib_close_prev_enabled Then EnableMenuItem (GetSystemMenu(handle(parentwindow()), FALSE), SC_CLOSE, MF_BYCOMMAND + MF_ENABLED) End If  

Continue Reading

PowerBuilder, different DD list values for each row, another way

https://pbbraindump.wordpress.com/2008/11/16/the-ol%E2%80%99-hidden-items-in-the-dddw-problem-part-ii/ Make a second copy of the Color column and have this always contain all the rows in its dddw.  This second column is never filtered. When the row is not the current row, display the column with the unfiltered dddw and hide the filter column.  If the row is the current row, show the column with the filtered dddw, and hide the column with the dddw with all the possible rows.  To do this, add the following expression to the visibility attribute of the column with the dddw which…

Continue Reading

PowerBuilder, different DD list values for each row

Source http://www.pbdr.com/pbtips/dw/fltrdddw.htm Step 1 - declare instance variables boolean ib_dropdowndropped = False boolean ib_dropdownredrawn = True Step 2 - extend the pbm_dropdown event ib_dropdowndropped = True ib_dropdownredrawn = False of_Filter(True) ib_dropdownredrawn = True Step 3 - extend the pbm_ncpaint event If (ib_dropdowndropped And ib_dropdownredrawn) Then ib_dropdowndropped = False ib_dropdownredrawn = False of_Filter(False) ib_dropdownredrawn = True End If Step 4 - write the of_Filter (boolean ab_switch) subroutine datawindowchild ldwc long ll_getitemnumber string ls_setfilter = "" If (ab_switch) Then ll_getitemnumber = GetItemNumber(GetRow(), "order_status_id") If (ll_getitemnumber = 1) Then // cancelled -> cancelled ls_setfilter…

Continue Reading

Bowerbuilder datawindow autosize problem

You have a datawindow. Datawindow has an Autosize Height set to Details band. You insert a row, set a long string value to some field expecting that field to be auto-sized. And it is, but you don't see a text as Details band does not auto-size. What to do? Whan way to fix this is to call Sort() somewhere after you set v the value fro the datawindow to refresh and auto-size to take effect. But that does not work all times ( for example ... you dont want to sort data now). Another way…

Continue Reading

Calling .NET from PowerBuilder

To call .NET for PowerBuilder best option is to create Class Library in Visual Studio. Sign it. In project properties, Application, Assembly Information..., check "Make assembly COM-Visible". Sign it class library (project properties, Signing...). In project properties, Application, Assembly Information..., check "Make assembly COM-Visible". Optional, add these attributes to your class: [ComVisible(true)] [ClassInterface(ClassInterfaceType.AutoDual)] [ProgId("ClassLibrary1.Class1")] Register created DLL in command lime like: regasm /tlb "path/to/dll/file.dll" /codebase Use it from PowerBuilder like: To call some web service from this DLL you add service reference and then:

Continue Reading

List services problem in Windows 10 and PowerBuilder .NET 12.5

Windows 10 / PowerBuilder .NET 12.5 Trying to make web service client and list services I get an error: Windows SDK for .Net Framework 4.0 was not installed. Please install it before use this feature. Tried to install Microsoft Windows SDK for Windows 7 and .NET Framework 4 (ISO) but that did not help. So I downloaded ProcessMonitor to check what for PowerBuilder .NET is looking and cannot find.  Found that it is looking for [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v7.1\WinSDK-NetFx40Tools-x86] and does not find it. In my registry, I had tools in v8.0A WinSDK-NetFx35Tools-X86, so I just for test…

Continue Reading

PowerBuilder and Norwegian/Finish/Serbian string to date conversion on Windows 10

Problem: Problem is in system locale on Windows 10. In Windows 10 Microsoft changed date time formats for some regions: Finnish, Norwegian Bokmål (“Norway” and “Svalbard and Jan Mayen” variants), Serbian (variants “Cyrillic, Kosovo”, “Latin, Montenegro”, “Latin, Serbia” and “Latin, Kosovo”). It was internally changed so that it has now the same separator in date and time parts. For example, previously format was "01.01.2001 11:01" now is "01.01.2001 11.01". It is so even if in regional settings user sets ":" as time separator. It was reported in other systems that…

Continue Reading

PowerBuilder and SQL Sever ‘row changed between retrieve and update’ error.

One issue I was working on was triggering 'row changed between retrieve and update' error on DataWindowupdate. Code was kinda simple, just retrieve some values in DataWindow, move some values to Deleted buffer and then call update. No other data manipulations etc. Found that table had some database trigger that was fired on delete. Disabled the trigger and there error message was gone. So trigger was causing that. Trigger also was quite simple, just cursor going through deleted rows and selecting and updating few values in other tables. Googling told…

Continue Reading

End of content

No more pages to load

Close Menu