NC Clone

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
gfilatov
Posts: 762
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 30 times
Been thanked: 403 times
Contact:

Re: NC Clone

Post by gfilatov »

AUGE_OHR wrote:
Fri Sep 25, 2020 5:40 am
hi,

it seem there is a big BUG in HBFM since v1.17 :shock:

after delete a File HBFM does not work correct with F3/F4 and show "black" Window or "no Image" etc. :evil:
Hi Jimmy,

You are correct - there is a bug in the C-function GETICOINDEX().

Please take a look for the fixed function below:

Code: Select all

HB_FUNC( GETICOINDEX )
{
   int nSize = ( HB_ISNUM( 2 ) ? hb_parni( 2 ) : 0 );

   SHFILEINFO sfi = { 0 };

   SHGetFileInfo( hb_parc( 1 ), 0, &sfi, sizeof( SHFILEINFO ), SHGFI_ICON | nSize );

   hb_retnl( ( LONG ) sfi.iIcon );

   HB_STORNL( ( LONG_PTR ) ( HICON ) sfi.hIcon, 3 );
}
Sample code:

Code: Select all

...
         nIndex := GETICOINDEX( cFile, nSize, @hIcon )
      ENDIF

      ListView_SetItemImageIndex( GetControlHandle( cObj, cForm ), i, 1, nIndex )

      IF Valtype( hIcon ) != "U"
         IF DestroyIcon( hIcon )
            hIcon := NIL
         ENDIF
      ENDIF
Hope that helps :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
AUGE_OHR
Posts: 1073
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 186 times
Been thanked: 296 times

Post by AUGE_OHR »

hi,
gfilatov wrote:
Fri Sep 25, 2020 9:41 am
You are correct - there is a bug in the C-function GETICOINDEX().

Please take a look for the fixed function below:
Hope that helps :idea:
YES , THX :!:

i have not test to Delete Files so i have not recognize my Error, sorry :roll:

so here latest Version v1.29

32 Bit
HBFM_129.zip
(2.19 MiB) Downloaded 20 times
64 Bit
HBFM64_129.zip
(2.51 MiB) Downloaded 17 times

i will also update on GitHub.
i will add a Folder \SOURCE which include Change of HMG LIB to use Type "T" or "@" and "I"
please look into README.TXT

! Note : Files are documented by CLICK
// v.1.29 22.09.2020 BUG GETICOINDEX() sind v1.17 in FMGRID.PRG DirImageColor()
// v.1.28 21.09.2020 integrate VFP Type "I" and "@" (Timestamp)
// need change in HMG \Source\H_BROWSE.PRG amd h_controlmisc.prg
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 1073
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 186 times
Been thanked: 296 times

Post by AUGE_OHR »

latest Version v1.35

32 Bit
HBFM_135.zip
(2.2 MiB) Downloaded 16 times
64 Bit
HBFM64_135.zip
(2.52 MiB) Downloaded 17 times
i have change Image Viewer while i want to add

Code: Select all

   // more FreeImage
   CASE cExt $ ".PSD.ICO.EXR.PCX.PPM.PSD.WEBP.JP2.PPM"
now i "paint" Picture using BitBlt() / StretchBlt()

if Edit Picture all is done on "temp file" and later ask to save it

! Note : rotate in Thumbs WILL change Original Picture without asking !

fixed :
BUG DestroyIcon() for HMG

new :
HB_FUNC.PRG for 32 and 64 Bit
// v.1.35 03.10.2020 BUG DestroyIcon() for HMG_*
// v.1.34 30.09.2020 HB_FUNC.PRG "64 Bit ready" using HMG_* instead of hb.*
// v.1.33 29.09.2020 FreeImage : HB_FUNC ( FREE_DRAWPICTURE ) re-size
// v.1.32 28.09.2020 FreeImage Workfile when view or rotate.
// will ask to Save Workfile which Replace Original !
// Thumbs direct Replace Original !
// v.1.31 27.09.2020 FreeImage now also use for Viewer and Picture > Screen
// v.1.30 26.09.2020 Problem when delete many Files. now BEGIN SEQUENCE
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 1073
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 186 times
Been thanked: 296 times

Post by AUGE_OHR »

here lates Ver v1.38

32 Bit
HBFM_138.zip
(2.2 MiB) Downloaded 10 times
64 Bit
HBFM64_138.zip
(2.52 MiB) Downloaded 10 times
after got that "Apple Email Attachment" i have change Codepage to UTF8

but i also have to change DLL Funtion from "A" to W"
FreeImage and ShFileOperation are still ANSI so i have to convert Filename to ANSI when call these Function

btw. Extended Version have ShFileOeration but also only "A" Version.
c:\MiniGUI\SOURCE\shell32\Shell32.prg

---

i do upload each Version to Github but only "Stable" Version in Forum.
if you find a reproducible Error please write me a Email (about -> mail to author )

fixed : DestroyIcon() 2nd fix in HB_FUNC.PRG

New : UTF8 as default Codeepage.
change DLLcall from "A" to "W"

add : runAs Adminstrator in Pop-Up Menu
// v.1.38 13.10.2020 German "umlaute" from Apple Email CHR(204)
// v.1.37 07.10.2020 enhance HMG_Calldll() "A" and "W"
// v.1.36 06.10.2020 change to Codepage UTF8
have fun
Jimmy

Post Reply