1. Chris Butler
  2. PowerBuilder
  3. Tuesday, 5 December 2023 20:53 PM UTC

Looking for advice regarding the PB.INI setting UseHwnd.

I've seen multiple comments indicating when this is set to No, (UseHwnd=0) it can provide significant performance gains. 

For anybody using this setting can you tell me where exactly you see performance gains? 

Is anybody aware of any potential fallout when using this setting? 

I'd like to know more about it before I consider adding it to the .ini file of our application.

Any comments are greatly appreciated.

Thank you.

 

 

 

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 5 December 2023 22:21 PM UTC
  2. PowerBuilder
  3. # 1

Hi Chris;

   This is to prevent the DS's from allocating MS-Window "Handles" on a CREATE command and then having to release these resources on a DESTROY command. The process of allocating and de-allocating "handles" plus the O/S resources that takes (Memory + CPU) can really add-up. The big gains are when a PB App is using DS's in a loop or there are many DS's coming and going across multiple parts of your App during a processing cycle. Then you should definitely notice a performance difference of both a drop of memory "used" & CPU used in your PB App at execution time.  HTH

Regards ... Chris

Comment
  1. Roland Smith
  2. Wednesday, 6 December 2023 02:06 AM UTC
The datastore is actually quasi-nonvisual. It still has to allocate graphical handles and bitmap memory buffers on the chance that it might have to print the datawindow. This setting turns the datastore into a true non-visual object. If printing is required, you would have to use a hidden datawindow control.
  1. Helpful
  1. Benjamin Gaesslein
  2. Wednesday, 6 December 2023 11:28 AM UTC
You can still print a Datastore with UseHwnd=No but the print dialog won't work properly. I use a workaround I described in this thread, I think Miguel has since incorporated this into the PFC.



https://community.appeon.com/index.php/qna/q-a/need-for-documentation-on-all-existing-pb-ini-entries
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 6 December 2023 10:56 AM UTC
  2. PowerBuilder
  3. # 2

Hi,

Go to https://www.pb.miguell.work/pb-ini/list-entries and search on UseHwnd.

There's some links there of several people who had several problems when setting it to 0 / No.

regards

PS: I'm not sure how many of these problems might have been resolved in later versions.

Comment
  1. Miguel Leeuwe
  2. Wednesday, 6 December 2023 21:27 PM UTC
Hmm, very strange. When I go to my page, there's no such google.com interference. It's just on the pasted text.

Let me just delete the pasted text so people go to the linked page.

  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 7 December 2023 15:05 PM UTC
It's a google doc. My links don't include the reference to google.com. So it must be something Google likes to mess with. I don't know how to get rid of it.
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 7 December 2023 15:06 PM UTC
Maybe I should make a real web page :)
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.