GDIP Application crash tBitmap

GDIP Application crash tBitmap

Postby Silvio.Falconi » Tue Apr 11, 2023 7:42 am

I must make an insert of an array and I use png for btnbmp with variable GDIP as told me NagesWarao in this forum
and I have allways crash


the error
Code: Select all  Expand view  RUN

Application Internal Error - C:\Work\errori\edit_riga\ut_modriga.Exe
Terminated at: 2023-04-10 21:47:24
Unrecoverable error 6005: Exception error:

    Exception Code:C0000005 ACCESS_VIOLATION
    Exception Address:775B4624
    EAX:00004075  EBX:00F13140  ECX:9EFD55D3  EDX:00F132C0
    ESI:00F132B8  EDI:00F10000  EBP:0019E378
    CS:EIP:0023:775B4624  SS:ESP:002B:0019E228
    DS:002B  ES:002B  FS:0053  GS:002B
    Flags:00210246
    Exception Parameters: 00000000 00004075
    CS:EIP: 8B 00 8B 49 04 3B C1 0F 85 BA 02 00 00 3B C2 0F
    SS:ESP: 2BE22E03 00F131E8 00F10000 00000000 12000012 00F10000 16000016 029E232C 0000007F 00F12110 0019E2A4 00F102EC 04FC0740 00000015 A30C79EE FFFFFFFC

    C stack:
    EIP:     EBP:       Frame: OldEBP, RetAddr, Params...
    775B4624 0019E378   0019E3D4 775F7B9D 00F131E8 00F131F0 00F131F0 00F10000 00F131F0 00F11DE8 67E452B7 00F131F0
    775F7B9D 0019E3D4   0019E3F0 775B3CE6 00000000 00000000 00000000 005D0B27 00001372
    775B3CE6 0019E3F0   0019E418 67E37726 00F10000 00000000 00F131F0 00000000 0000177F 0000043F FFFFF3C0 00001372
    67E37726 0019E418   0019E428 00449FCD 00F131F0 0084DCC8
    00449FCD 0019E428   0019E464 004470F3 00F131F0 00000003 0019EDA0 0041F0D7 007DB088 0019E438 00000024 005D0B27
    004470F3 0019E464   0019E480 004EB288 000000C7 00000001 00EE2314 00000000 00000000
    004EB288 0019E480   0019E594 004E500F 00000001 005D928F 00000000 0084DCC8 028874AC 04F78D9C 04F78D9C 0000000F
    004E500F 0019E594   0019E5A4 00426B94 005D0A72 005CD50C
    00426B94 0019E5A4   0019E5C0 004EB288 000000BD 00000001 00EE2314 00000000 000004A0
    004EB288 0019E5C0   0019E6D4 004E500F 00000001 005D8FA0 00000000 005D58A4 009A5A6C 028874AC 04F78D9C 04F78D9C
    004E500F 0019E6D4   0019E6E4 00426FBC 005D919C 005D4704
    00426FBC 0019E6E4   0019E704 004EB445 0084DCC8 000000BB 00000001 00EE2314 02BD000C 00000458
    004EB445 0019E704   0019E818 004E5150 00000000 00000000 00000002 005BA200 00000004 028874AC 04F78D9C 04F78D9C
    004E5150 0019E818   0019E828 00426F44 005D8F99 005D4704
    00426F44 0019E828   0019E848 004EB338 00000000 000000B6 00000001 00EE2314 0147000C 000003F3
    004EB338 0019E848   0019E854 004EB759 04F50000
    004EB759 0019E854   0019E87C 00441505 00000000 005EDF88 00000000 005E9AD4 00000003 0019E89C 004EB406 00ABBB94
    00441505 0019E87C   0019E89C 004EB445 0084DCC8 000000B0 00000001 00EE2314 01220005 00000000
    004EB445 0019E89C   0019E9B0 004E5150 00000003 005DB6DE 00000000 005D6064 0019E8BC 028874AC 04F78D9C 04F78D9C
    004E5150 0019E9B0   0019E9C0 00428178 005EDD3F 005E8684


Modules:
00400000 00492000 C:\Work\errori\edit_riga\ut_modriga.Exe
77570000 001A4000 C:\WINDOWS\SYSTEM32\ntdll.dll
75500000 000F0000 C:\WINDOWS\System32\KERNEL32.DLL
76F40000 0021C000 C:\WINDOWS\System32\KERNELBASE.dll
75800000 0007B000 C:\WINDOWS\System32\ADVAPI32.DLL
75710000 000BF000 C:\WINDOWS\System32\msvcrt.dll
75CE0000 00076000 C:\WINDOWS\System32\sechost.dll
758C0000 000BE000 C:\WINDOWS\System32\RPCRT4.dll
77430000 000AF000 C:\WINDOWS\System32\COMDLG32.DLL
75E70000 00281000 C:\WINDOWS\System32\combase.dll
745C0000 00019000 C:\WINDOWS\SYSTEM32\MPR.DLL
767D0000 00120000 C:\WINDOWS\System32\ucrtbase.dll
755F0000 00087000 C:\WINDOWS\System32\shcore.dll
744B0000 00073000 C:\WINDOWS\SYSTEM32\WINSPOOL.DRV
759A0000 0019D000 C:\WINDOWS\System32\USER32.dll
74BA0000 00008000 C:\WINDOWS\SYSTEM32\VERSION.DLL
767B0000 00018000 C:\WINDOWS\System32\win32u.dll
75890000 00023000 C:\WINDOWS\System32\GDI32.dll
74720000 00210000 C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_a8625c1886757984\COMCTL32.DLL
75B40000 000E0000 C:\WINDOWS\System32\gdi32full.dll
774E0000 0007B000 C:\WINDOWS\System32\msvcp_win.dll
77160000 00045000 C:\WINDOWS\System32\SHLWAPI.dll
761F0000 005B7000 C:\WINDOWS\System32\SHELL32.dll
75D80000 000E3000 C:\WINDOWS\System32\OLE32.DLL
76100000 00096000 C:\WINDOWS\System32\OLEAUT32.DLL
74DB0000 00028000 C:\WINDOWS\SYSTEM32\WINMM.DLL
67DD0000 00167000 C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.19041.2251_none_d9513b1fe1046fc7\GDIPLUS.DLL
74D80000 0002C000 C:\WINDOWS\SYSTEM32\OLEDLG.DLL
74D70000 00006000 C:\WINDOWS\SYSTEM32\MSIMG32.DLL
757D0000 00025000 C:\WINDOWS\System32\IMM32.DLL
73B30000 00074000 C:\WINDOWS\system32\uxtheme.dll
76E00000 000D4000 C:\WINDOWS\System32\MSCTF.dll
74680000 0000F000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll
75430000 0005F000 C:\WINDOWS\System32\bcryptPrimitives.dll
6BC30000 000BA000 C:\WINDOWS\SYSTEM32\textinputframework.dll
6BB90000 0009B000 C:\WINDOWS\System32\CoreMessaging.dll
6B780000 0027E000 C:\WINDOWS\System32\CoreUIComponents.dll
75490000 00063000 C:\WINDOWS\System32\WS2_32.dll
74480000 00029000 C:\WINDOWS\SYSTEM32\ntmarta.dll
6BAB0000 000DB000 C:\WINDOWS\SYSTEM32\wintypes.dll
6B720000 00053000 C:\WINDOWS\system32\Oleacc.dll
6B680000 00094000 C:\WINDOWS\SYSTEM32\TextShaping.dll
6B160000 00171000 C:\WINDOWS\SYSTEM32\WindowsCodecs.dll
75D60000 00019000 C:\WINDOWS\System32\bcrypt.dll

Called from GDIP_DELETEIMAGE(0)
Called from PALBMPFREE(1184) in .\source\classes\BITMAP.PRG
Called from TBTNBMP:FREEBITMAPS(1112) in .\source\classes\BTNBMP.PRG
Called from TBTNBMP:DESTROY(1011) in .\source\classes\BTNBMP.PRG
Called from TWINDOW:HANDLEEVENT(0)
Called from TCONTROL:HANDLEEVENT(1855) in .\source\classes\CONTROL.PRG
Called from TBTNBMP:HANDLEEVENT(2051) in .\source\classes\BTNBMP.PRG
Called from _FWH(3560) in .\source\classes\WINDOW.PRG
Called from DIALOGBOXINDIRECT(0)
Called from TDIALOG:ACTIVATE(304) in .\source\classes\DIALOG.PRG
Called from EDIT_ROW(310) in ut_modriga.prg
Called from (b)MAIN(53) in ut_modriga.prg
Called from TBTNBMP:CLICK(713) in .\source\classes\BTNBMP.PRG
Called from TBTNBMP:LBUTTONUP(999) in .\source\classes\BTNBMP.PRG
Called from TCONTROL:HANDLEEVENT(1845) in .\source\classes\CONTROL.PRG
Called from TBTNBMP:HANDLEEVENT(2051) in .\source\classes\BTNBMP.PRG
Called from _FWH(3560) in .\source\classes\WINDOW.PRG
Called from DIALOGBOXINDIRECT(0)
Called from TDIALOG:ACTIVATE(304) in .\source\classes\DIALOG.PRG
Called from MAIN(77) in ut_modriga.prg
 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: GDIP Application crash tBitmap

Postby Antonio Linares » Tue Apr 11, 2023 7:46 am

Dear Silvio,

Please check that you are using a non zero and not nil value with GDIP_DELETEIMAGE()

Code: Select all  Expand view  RUN
HB_FUNC ( GDIP_DELETEIMAGE )
{
    Bitmap * pImage;

    if ( HB_ISPOINTER( 1 ) )
    {
        pImage = ( Bitmap * ) hb_parptr( 1 );
        delete pImage;
    }
   hb_ret();
}
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: GDIP Application crash tBitmap

Postby Silvio.Falconi » Tue Apr 11, 2023 9:37 am

ON SOURCE i MADE

@ nRow, 352 BTNBMP oBtnSel[1] RESOURCE "REP_CARICA";
FLAT SIZE 22, 23 OF oRigaModulo NOROUND GDIP PIXEL ;
TOOLTIP "Carica" ;
ACTION NIL

RC FILE
REP_CARICA 10 "table/folder_add.png"

Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: GDIP Application crash tBitmap

Postby Silvio.Falconi » Tue Apr 11, 2023 9:52 am

Antonio Linares wrote:Dear Silvio,

Please check that you are using a non zero and not nil value with GDIP_DELETEIMAGE()

Code: Select all  Expand view  RUN
HB_FUNC ( GDIP_DELETEIMAGE )
{
    Bitmap * pImage;

    if ( HB_ISPOINTER( 1 ) )
    {
        pImage = ( Bitmap * ) hb_parptr( 1 );
        delete pImage;
    }
   hb_ret();
}





 




how do i put it in the test?

Error E2451 ut_fonts.prg 10: Undefined symbol 'Bitmap' in function HB_FUN_GDIP_DELETEIMAGE
Error E2451 ut_fonts.prg 10: Undefined symbol 'pImage' in function HB_FUN_GDIP_DELETEIMAGE
Error E2188 ut_fonts.prg 14: Expression syntax in function HB_FUN_GDIP_DELETEIMAGE
Error E2451 ut_fonts.prg 15: Undefined symbol 'delete' in function HB_FUN_GDIP_DELETEIMAGE
Error E2379 ut_fonts.prg 15: Statement missing ; in function HB_FUN_GDIP_DELETEIMAGE
*** 5 errors in Compile ***

I try with it but make error




Code: Select all  Expand view  RUN

#pragma BEGINDUMP
#include "Windows.h"
#include "hbapi.h"


HB_FUNC ( GDIP_DELETEIMAGE )
{
    Bitmap * pImage;

    if ( HB_ISPOINTER( 1 ) )
    {
        pImage = ( Bitmap * ) hb_parptr( 1 );
        delete pImage;
    }
   hb_ret();
}
#pragma ENDDUMP
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: GDIP Application crash tBitmap

Postby nageswaragunupudi » Tue Apr 11, 2023 3:08 pm

Which version of FWH are you using?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GDIP Application crash tBitmap

Postby Antonio Linares » Tue Apr 11, 2023 3:36 pm

Dear Silvio,

It uses C++ code so you have to place it in a yours.cpp file
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: GDIP Application crash tBitmap

Postby Silvio.Falconi » Tue Apr 11, 2023 4:14 pm

nageswaragunupudi wrote:Which version of FWH are you using?


December 2021 to March 2022
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: GDIP Application crash tBitmap

Postby Jimmy » Tue Apr 11, 2023 7:54 pm

hi Silvio,
Silvio.Falconi wrote:Error E2451 ut_fonts.prg 10: Undefined symbol 'Bitmap' in function HB_FUN_GDIP_DELETEIMAGE
Error E2451 ut_fonts.prg 10: Undefined symbol 'pImage' in function HB_FUN_GDIP_DELETEIMAGE
Error E2188 ut_fonts.prg 14: Expression syntax in function HB_FUN_GDIP_DELETEIMAGE
Error E2451 ut_fonts.prg 15: Undefined symbol 'delete' in function HB_FUN_GDIP_DELETEIMAGE
Error E2379 ut_fonts.prg 15: Statement missing ; in function HB_FUN_GDIP_DELETEIMAGE
*** 5 errors in Compile ***

HB_FUNC( GDIP_DELETEIMAGE ) is in c:\fwh\source\winapi\gdipfwh.cpp and have these #include

Code: Select all  Expand view  RUN
#include <hbapi.h>
#include <hbapiitm.h>
#include <windows.h>
//#include <shlwapi.h>
#include <fwh.h>
#include <gdiplus.h>

#ifndef __GNUC__
   #include <gdiplusimaging.h>
#else
   #include <gdiplus/gdiplusimaging.h>
#endif


not sure but i "think" you also need all CODE from

Code: Select all  Expand view  RUN
static Bitmap * BitmapFromStream( LPSTREAM pStream, BOOL bAlpha )
...
 
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: GDIP Application crash tBitmap

Postby Giovany Vecchi » Tue Apr 11, 2023 8:07 pm

I had problems using Bitmaps with GDIPLUS for the following cause.
The tgdiplus.prg file has INIT PROCEDURE and my program also has it.
I solved it by calling GdiPlusStartup() at the beginning of my program in INIT PROCEDURE located in the first prg of my program.
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: GDIP Application crash tBitmap

Postby nageswaragunupudi » Wed Apr 12, 2023 10:07 am

Giovany Vecchi wrote:I had problems using Bitmaps with GDIPLUS for the following cause.
The tgdiplus.prg file has INIT PROCEDURE and my program also has it.
I solved it by calling GdiPlusStartup() at the beginning of my program in INIT PROCEDURE located in the first prg of my program.


An application can have any number of INIT PROCEDUREs.
All INIT PROCEDUREs will be executed at the start up of the application.
The INIT PROCEDURE in the Main module is guaranteed to execute FIRST. Other INIT PROCEDURES may be executed in any order.

So TGDIPLUS.PRG having an INIT PROCEDURE should not cause any problems.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GDIP Application crash tBitmap

Postby nageswaragunupudi » Wed Apr 12, 2023 10:09 am

I had problems using Bitmaps with GDIPLUS for the following cause.


You do not need to use special GDIPLUS functions to use GDI+ for bitmaps, etc.
Most of the GDI+ functionality is built into normal looking functions and methods depending on the need and choice.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GDIP Application crash tBitmap

Postby nageswaragunupudi » Wed Apr 12, 2023 10:33 am

Silvio
There is a bug.
We will provide a fix.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GDIP Application crash tBitmap

Postby Giovany Vecchi » Wed Apr 12, 2023 5:23 pm

nageswaragunupudi wrote:
Giovany Vecchi wrote:I had problems using Bitmaps with GDIPLUS for the following cause.
The tgdiplus.prg file has INIT PROCEDURE and my program also has it.
I solved it by calling GdiPlusStartup() at the beginning of my program in INIT PROCEDURE located in the first prg of my program.


An application can have any number of INIT PROCEDUREs.
All INIT PROCEDUREs will be executed at the start up of the application.
The INIT PROCEDURE in the Main module is guaranteed to execute FIRST. Other INIT PROCEDURES may be executed in any order.

So TGDIPLUS.PRG having an INIT PROCEDURE should not cause any problems.


The mistake is mine.
In the first module I have an INIT PROCEDURE and from within it I call MAIN(). That's why they don't load the other INIT PROCEDURE.
I've been wrong for years.
Thank you for the explanation.
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 49 guests