Pelles C forum

Assembly language => Assembly discussions => Topic started by: Jokaste on September 26, 2017, 06:05:31 PM

Title: Problem with Listview InsertItem
Post by: Jokaste on September 26, 2017, 06:05:31 PM
I have attached a entire asm program ! It is ok for all points except, it does not show the good image.


The program downloads all the image in https://commons.wikimedia.org/wiki/Accueil (https://commons.wikimedia.org/wiki/Accueil).
The downloaded files are stored into "My Pictures" folders.
After this step, I add the image to a image list.
After this step I insert an item (LVIF_IMAGE)
At the end, all the images are the same!


I wanted to finish the program to show you what I wrote in asm, but I can't.
There is a bug when you make the right-click (I wil correct it later).
I will give the user the possibility to select an URL.


For using the program, just right click on the window, all around the listview.
It did not catch the NM_CLICK for now.


If you could help me I appreciate very much.


Philippe RIO
http://imgtools.monsite-orange.fr/ (http://imgtools.monsite-orange.fr/)
Title: Re: Problem with Listview InsertItem
Post by: Jokaste on September 27, 2017, 03:14:33 PM
I have found the error. It is a bad alignment of pszText member in the LVITEM structure. I have added four padding bytes and it is OK.


Philippe RIO
http://imgtools.monsite-orange.fr/ (http://imgtools.monsite-orange.fr/)
Title: Final Version
Post by: Jokaste on September 27, 2017, 07:54:56 PM
(https://zf9p3w-dm2306.files.1drv.com/y4mT5a0nbmrJys6t4rWcCC7TgWqeX-1l3QSeY8VZQa1xk0ndh3Xv2_0nG_eBPDcq0s3LbeZ-QzlAr6GFJ42y1n6r_0E2zjjPfEl3pF-wfy3lTEead3ymq0Y8XmY5rIyxwexP6jqTgLWAxw_CNOyojIuNpwZ1NOl782zA0iCtKso33j4X8kAvHC74rIm1PrJjQTnUn4N07-QnF5RZQVzsyF7AQ?width=340&height=590&cropmode=none)