PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4

Author Topic: WinFBE 1.4.1 on GitHub (August 3, 2017)  (Read 1293 times)

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 1.4.0 on GitHub (August 2, 2017)
« Reply #30 on: August 03, 2017, 07:12:28 PM »

Awesome - thanks!
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #31 on: August 03, 2017, 09:59:02 PM »

Updated the FreeBasic project thread for WinFBE  http://www.freebasic.net/forum/viewtopic.php?f=8&p=234739#p234739
Added a shout out for Jose's awesome CWindow and class libraries.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2785
    • Josť Roca Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #32 on: August 03, 2017, 11:37:38 PM »

Thanks for the shout out.

You must check the code for Find/Replace. There must be a memory leak somewhere. The number of GDI objects in the Task Manager increases by more than 400 each time that I use it and eventually the editor stops working.

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #33 on: August 04, 2017, 10:27:52 AM »

Thanks Jose, I will investigate this today and track down the GDI leak. I'll post an update once it is corrected.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2785
    • Josť Roca Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #34 on: August 04, 2017, 01:49:09 PM »

From time to time I get a "Permission denied" message from the linker. This was also happening with previous versions of the editor.

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #35 on: August 04, 2017, 03:12:46 PM »

Thanks for the shout out.

You must check the code for Find/Replace. There must be a memory leak somewhere. The number of GDI objects in the Task Manager increases by more than 400 each time that I use it and eventually the editor stops working.


This appears to be related to me using GDI function to load png from resource but not releasing those pointer handles when subsequent calls to load additional images. I need to use GdiDispose (which I wasn't doing).
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #36 on: August 04, 2017, 03:13:39 PM »

From time to time I get a "Permission denied" message from the linker. This was also happening with previous versions of the editor.

This has happened to me also from time to time. Would love to be able to faithfully reproduce the circumstances that cause it.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #37 on: August 04, 2017, 03:44:45 PM »

Thanks for the shout out.

You must check the code for Find/Replace. There must be a memory leak somewhere. The number of GDI objects in the Task Manager increases by more than 400 each time that I use it and eventually the editor stops working.


This appears to be related to me using GDI function to load png from resource but not releasing those pointer handles when subsequent calls to load additional images. I need to use GdiDispose (which I wasn't doing).


Actually, this is not the case at all. I am using icons, not png for the find/replace graphics. Looks like I was using DeleteObject rather than DestroyIcon. Making the change helps considerable but there is still a 20 or 30 gdi leak each time the dialog is invoked. I am still investigating that.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #38 on: August 05, 2017, 01:36:35 PM »

Thanks for the shout out.

You must check the code for Find/Replace. There must be a memory leak somewhere. The number of GDI objects in the Task Manager increases by more than 400 each time that I use it and eventually the editor stops working.


Rarely do programming problems kick my ass as badly as this problem did. It took me hours to finally track down the source of the leak. Had really not much to do with the icons at all. There were two main problems:

1) Not DELETE the allocated pWindow memory for the main frmFindReplace dialog every time it was open and closed. Of course this prevented the destructor for each instance of the pWindow from firing.

2) For every child image button on the frmFindReplace dialog I was assigning a tooltip. However, I was not destroying the HWND window associated with the tooltip during the WM_DESTROY of each image button.

Things seem to be good now with the GDI resources.

As an aside, instead of tracking the GDI resources with the Windows Task Manager, it was much easier to display the GDI cound in the WinFBE task bar using a timer that fired every 500ms.

Code: [Select]
      if uMsg.message = WM_TIMER then
         Dim As HWnd hStatusbar = GetDlgItem(HWnd_FRMMAIN, IDC_FRMMAIN_STATUSBAR)
         static GUILeak as wstring * 100
         dim hProcess AS HANDLE
         dim dwProcessID as dword
         getwindowthreadprocessid( HWnd_FRMMAIN, @dwProcessID)
         hProcess = openprocess(PROCESS_QUERY_INFORMATION OR PROCESS_VM_READ, 0, dwProcessID)
         GUILeak = "GDICount: " & str(getguiresources(hProcess, GR_GDIOBJECTS))
         StatusBar_SetText(hStatusbar, 0, GUILeak)
      end if


I am uploading the new version (1.4.2) to GitHub and will post the release details.

Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2785
    • Josť Roca Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #39 on: August 05, 2017, 02:18:46 PM »

Seems to we working fine now.

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2785
    • Josť Roca Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #40 on: August 05, 2017, 02:23:13 PM »

And apparenty you also have fixed the problem of DebugView reporting a bunch of wrong API calls. Maybe it was caused by the wrong use of DeleteObject rather than DestroyIcon.

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #41 on: August 06, 2017, 02:15:48 PM »

I'm working on adding the User Tools dialog (attached). Similar to the functionality in FireFly.

Jose, anything you need added? I'm thinking that after this dialog that I should concentrate on improving the codetips/completion. Most likely implement it with threads to monitor code as it is typed rather than doing the parse whenever the source file is saved. I want to switch to use your dictionary code rather than the primitive db system I cobbled together within the editor.

I also want to get back at the GUI library that I am building on top of your CWindow and classes. I have a strong feeling that if I can present a .dot style framework with all of the flexibility and speed that your framework provides then there would be much more uptake from Windows programmers in the FB world.

Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2785
    • Josť Roca Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #42 on: August 06, 2017, 02:38:44 PM »

In the tools manager that I did for my editor, I have a checkbox labeled "Display this item in the editor menu". When the editor starts, it reads the database and displays the checked items in a Tools menu and, if the extension is .chm, it does it in the Guides menu.
« Last Edit: August 06, 2017, 03:17:45 PM by Josť Roca »
Logged

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2785
    • Josť Roca Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #43 on: August 06, 2017, 02:46:18 PM »

Quote
I also want to get back at the GUI library that I am building on top of your CWindow and classes. I have a strong feeling that if I can present a .dot style framework with all of the flexibility and speed that your framework provides then there would be much more uptake from Windows programmers in the FB world.

With so many VBer's wandering around, I won't be surprised. The pity is that coding this way they will never learn to use the Windows API, and what would be of them without the SDK programmers?

Many years ago I read something like C++ programmers should be gratefully indebted to the designers of VB because they had provided them with a good way of earning money writing OCXs for VB.

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 1.4.1 on GitHub (August 3, 2017)
« Reply #44 on: August 06, 2017, 03:07:25 PM »

Many years ago I read something like C++ programmers should be gratefully indebted to the designers of VB because they had provided them with a good way of earning money writing OCXs for VB.

:D  That's so true, and I was one of those poor souls who started Windows programming using VB. I learned WinAPI and GUI programming when I switched to PB and starting coding the JellyFish editor. Seems like a lifetime ago now!
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor
Pages: 1 2 [3] 4