Hi, I have a function which crashes when I call it a second time.
The function in execute.prg is named Afaire() uses hcedit and the functions isLock(), idOver() in keyboard.prg
If I comment all the @x,y bitmap, it doesn't crash anymore because a Segmentation fault, just an error (normal). If I add a comment before ON ACTIVATE, no more error.
Where do I fail ?
A+
Hi, this function is present in all my programs, ans it doesn't crash when I dont use embedded images
It seems to be the reason.
Is-it a bug or is-it normal ?
Thanks
A+
Last edit: Aupeix Alain 2022-08-09
Hello Alain,
to reproduce the bug i tried to compile the HWMAKE utility with some modifications,
please check commit of r15.
The build of hwmake was successful,
but i got some error messages
listed in the appenden text file.
I am very busy, can you look for ?
But another way is to post a sample program with hbp file only demonstrating the bug.
A long time ago, i checked the usage of bitmaps and i added the following
information:
4.3.28. @ <x>,<y> BITMAP
...
Supported image formats see documentation for CLASS HBITMAP.</y></x>
The parameters <obmp> SHOW , SIZE and "OF" are on GTK mandatory,
otherwise the image does not appear !
For details see sample program "bincnts.prg".
For the SIZE parameter pass the real size of the image to display.</obmp>
Hello Alain,
I created ticket #1 on project HWLABEL with title:
Open discussion for developpers
to continue our discussion on Tickets #109 and #111.
With regards,
MNI TNX, 73 es 55 de
DF7BE, Wilfried
HWLABEL ?
Are you sure ?
Hello Alain,
sorry, very hot here,
of course HWMAKE !
With regards,
MNI TNX, 73 es 55 de
DF7BE, Wilfried
Hi, here is the test for the bug with hex BITMAP.
Thanks
A+
Hello Alain,
i attached the used hbp file.
I got a compile message:
Test_image.prg(250) Warning W0001 Ambiguous reference 'CBUTTON'
So i detected, that the variable "cButton" is not declared and filled with a value in
function IsOver()
Please send me the modification.
With regards,
MNI TNX, 73 es 55 de
DF7BE, Wilfried
Hello Alain,
to continue my work, i commented out the -w option.
I started the program and it crashes at pressing the cross button:
Error BASE/1003 Variable does not exist: ONCAPS_AFAIRE.
In background the dialog window is visible
The run command works OK:
sh -c 'xset -q | grep Caps'
00: Caps Lock: off 01: Num Lock: off 02: Scroll Lock: off
I have an idea:
For multi platform usage, it is at it best, to use BMP instead of PNG.
For conversion install the package "imagemagick" on the LINUX system
and say
convert xyz.png -depth 8 xyz.bmp
(-depth 8 = 256 colours)
With regards,
MNI TNX, 73 es 55 de
DF7BE, Wilfried
Hi,
For the missing declaration of cButton, it's an error, no need of cButton in isOver():
I had already install imagemagick, this nice tool.
I have replaced num, caps ins and over png by bmp, and regenerated inithex.prg
I have completed public declaration of o?nm_Afaire, o?caps_Afaire, oins_Afaire and oover_Afaire
No more warning when building, but it always crash the second time I call RunError()
Where do I always fail ?
Have you also this crash ?
Yes but 'Scroll Lock' isn't correctly reported (always off)
Here is a modified version, as said, of Test_image.
Thanks
A+
Hello Alain,
i spent some time to find the reason for
the crash, the solution is very simple.
With commit r3109 i added the following information:
see file utils/bincnt/Readme.txt:
The appended archive contains your test program
with the fixed error, please check.
Please give feedback, if this ticket can be closed.
With regards,
MNI TNX, 73 es 55 de
DF7BE, Wilfried
Hi Wilfried,
Yes this solve the crash.
I just make local.prg like this, to avoid having to insert HBitmap():addstring() lines in the function:
Obviously, cVal and cHex variables are declared in public.prg and cVal variables are generated in loadhex.prg ... To avoid warning, when the function which use these features is in another prgfile, cVal variables are declared as memvar in the concerned prg.
And it works like a charm ...
I will modify my function inclure() in hwmake to generate local.prg,
You can close.
Thanks
A+
Hello Alexander, Hello Maurizio,
please close this ticket.
Or may I become the project admin role so that I can handle tickets ?
With regards,
MNI TNX, 73 es 55 de
DF7BE, Wilfried
Ticket Closed.