2nd Imagelist fpr GRID

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

2nd Imagelist fpr GRID

Post by AUGE_OHR »

hi,

i try to enhance GRID with 2nd Imagelist "hImageBig" but have Problem

File c:\hmg.3.4.4\SOURCE\C_GRID.C

Code: Select all

HB_FUNC (ADDLISTVIEWBITMAP)
{
	HWND hGrid = (HWND) HMG_parnl (1);
	HIMAGELIST hImageList = NULL;
	HIMAGELIST hImageBig = NULL;
	TCHAR *FileName;
	int nCount, i;
	int nWidth = 0;

	nCount = hb_parinfa (2, 0);

	if ( nCount > 0 )
	{
		int Transparent = hb_parl(3) ? 0 : 1;

		for (i=1; i <= nCount; i++)
		{
			FileName = (TCHAR*) HMG_parvc (2, i);
			if ( hImageList == NULL )
				hImageList = HMG_ImageListLoadFirst (FileName, nCount, Transparent, &nWidth, NULL);
			else
				HMG_ImageListAdd (hImageList, FileName, Transparent);
		}

		{
			if ( hImageBig == NULL )
				hImageBig = HMG_ImageListLoadFirst (FileName, nCount, Transparent, &nWidth, NULL);
			else
				HMG_ImageListAdd (hImageBig, FileName, Transparent);

		}

		if ( hImageList != NULL )
			SendMessage (hGrid, LVM_SETIMAGELIST, (WPARAM) LVSIL_SMALL, (LPARAM) hImageList);

		if ( hImageBig != NULL )
			SendMessage (hGrid, LVM_SETIMAGELIST, (WPARAM) LVSIL_NORMAL, (LPARAM) hImageBig);
	}

	hb_retni ((INT) nWidth );
}
i got Error
c:/hmg.3.4.4/source/c_grid.c:813:1: error: stray '\32' in program
but that line is behind EOF of File :o
who can help me please
have fun
Jimmy
gisjr134
Posts: 47
Joined: Tue Dec 08, 2020 11:37 am
DBs Used: DBF,MySQL,PostgreSQL
Location: Brasil
Contact:

Re: 2nd Imagelist fpr GRID

Post by gisjr134 »

Hi , Are you using a Dos Like Editing Tool? Perhaps it´s some carachter at the end of The line , try adding a new Line.
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: 2nd Imagelist fpr GRID

Post by edk »

Are you sure this notation is correct?

Code: Select all

for (i=1; i <= nCount; i++)
		{
			FileName = (TCHAR*) HMG_parvc (2, i);
			if ( hImageList == NULL )
				hImageList = HMG_ImageListLoadFirst (FileName, nCount, Transparent, &nWidth, NULL);
			else
				HMG_ImageListAdd (hImageList, FileName, Transparent);
		}

		{
			if ( hImageBig == NULL )
				hImageBig = HMG_ImageListLoadFirst (FileName, nCount, Transparent, &nWidth, NULL);
			else
				HMG_ImageListAdd (hImageBig, FileName, Transparent);

		}
I'm not a C specialist, but I guess you have two blocks of code, the second one with no loop declared.
Maybe it should look like this? ¯\_(ツ)_/¯ :

Code: Select all

for (i=1; i <= nCount; i++)
		{
			FileName = (TCHAR*) HMG_parvc (2, i);
			if ( hImageList == NULL )
				hImageList = HMG_ImageListLoadFirst (FileName, nCount, Transparent, &nWidth, NULL);
			else
				HMG_ImageListAdd (hImageList, FileName, Transparent);

			if ( hImageBig == NULL )
				hImageBig = HMG_ImageListLoadFirst (FileName, nCount, Transparent, &nWidth, NULL);
			else
				HMG_ImageListAdd (hImageBig, FileName, Transparent);

		}
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: 2nd Imagelist fpr GRID

Post by AUGE_OHR »

hi,
gisjr134 wrote: Mon Jan 23, 2023 12:55 pm Hi , Are you using a Dos Like Editing Tool? Perhaps it´s some carachter at the end of The line , try adding a new Line.
you are right, it was my "old" ETP Editor which use CTRL-Z at End
i "saw" it when use Notepad++ :shock:

---

neverless i still get no "Icon-Style" so something else is missing ... :(
have fun
Jimmy
Post Reply