Pelles C forum

C language => Beginner questions => Topic started by: Grincheux on February 26, 2016, 08:27:23 PM

Title: Bizarre
Post by: Grincheux on February 26, 2016, 08:27:23 PM
MSVC2015
(http://www.phrio.biz/ImagesViewer/bugs/MVSC2015.jpg)

PELLES
(http://www.phrio.biz/ImagesViewer/bugs/Pelles.jpg)

Code: [Select]
#define __STDC_WANT_LIB_EXT1__ 1

#include <windows.h>
#include <Commctrl.h>
#include <shlwapi.h>

#include "ImagesViewer.h"

#include "libgfl.h"
#include "libgfle.h"
#include "Images.h"
#include "sqlite3.h"
#include "Resources.h"
#include "Functions.h"
#include "Datas.h"
#include "Utils.h"

#ifdef __POCC__
#pragma warn(disable: 2216)
#endif

LRESULT ImagesToolBar_OnNotify(LPARAM __lParam)
{
LVITEM _Lvi ;
char _szTmp[MAX_PATH] ;
char _szImg[MAX_PATH] ;
LPNMITEMACTIVATE _lpItem ;
LVHITTESTINFO _Hit ;
int _FileSize,_ImageWidth,_ImageHeight,_ImageSize ;
char _szFormatName[256] ;

_lpItem = (LPNMITEMACTIVATE) __lParam ;

if(_lpItem->hdr.code == NM_CLICK)
{
if(_lpItem->hdr.idFrom == IDW_LISTVIEW_IMGTLB)
{
memset(&_Lvi,0,sizeof(LVITEM)) ;
memset(_szTmp,0,MAX_PATH) ;

_Hit.pt.x = _lpItem->ptAction.x ;
_Hit.pt.y = _lpItem->ptAction.y ;
_Hit.flags = LVHT_ONITEMICON ;
_Hit.iItem = 0 ;
_Lvi.iItem = (int) SendMessage(_lpItem->hdr.hwndFrom,LVM_HITTEST,0,(LPARAM) &_Hit) ;
_Lvi.mask = LVIF_PARAM | LVIF_TEXT ;
_Lvi.cchTextMax = MAX_PATH ;
_Lvi.pszText = _szTmp ;

SendMessage(_lpItem->hdr.hwndFrom,LVM_GETITEM,0,(LPARAM) &_Lvi) ;
if(_Lvi.iItem != -1)
{
memset(_szImg,0,sizeof(_szImg)) ;
SQLite_GetFileName((int) _Lvi.lParam,_szImg) ;

if(lstrlen(_szImg))
{
if(PathFileExists(_szImg))
{
lstrcpy(szCurrentFile,_szImg) ;

SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 1,(LPARAM) (LPSTR) PathFindFileName(_szImg)) ;

GetImageFileProperties(szCurrentFile,&_FileSize,&_ImageSize,_szFormatName,&_ImageWidth,&_ImageHeight) ;

sprintf_s(_szTmp,sizeof(_szTmp),"W = %d / H = %d",_ImageWidth,_ImageHeight) ;
SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 2,(LPARAM) (LPSTR) _szTmp) ;

sprintf_s(_szTmp,sizeof(_szTmp),"File size = %d",_FileSize) ;
SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 3,(LPARAM) (LPSTR) _szTmp) ;

sprintf_s(_szTmp,sizeof(_szTmp),"Image size = %d",_ImageSize) ;
SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 4,(LPARAM) (LPSTR) _szTmp) ;

SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 5,(LPARAM) (LPSTR) _szFormatName) ;

InvalidateRect(hEffects,NULL,TRUE) ;
InvalidateRect(hZoom,NULL,TRUE) ;

Memory_CreateImageList(szCurrentFile) ;
RealSizeImage_CreateImageList(szCurrentFile) ;
}
}
}
}
}
else
{
if(_lpItem->hdr.code == NM_DBLCLK)
{
if(_lpItem->hdr.idFrom == IDW_LISTVIEW)
{
memset(&_Lvi,0,sizeof(LVITEM)) ;
memset(_szTmp,0,MAX_PATH) ;

_Hit.pt.x = _lpItem->ptAction.x ;
_Hit.pt.y = _lpItem->ptAction.y ;
_Hit.flags = LVHT_ONITEMICON ;
_Hit.iItem = 0 ;
_Lvi.iItem = (int) SendMessage(_lpItem->hdr.hwndFrom,LVM_HITTEST,0,(LPARAM) &_Hit) ;
_Lvi.mask = LVIF_PARAM | LVIF_TEXT ;
_Lvi.cchTextMax = MAX_PATH ;
_Lvi.pszText = _szTmp ;

SendMessage(_lpItem->hdr.hwndFrom,LVM_GETITEM,0,(LPARAM) &_Lvi) ;
if(_Lvi.iItem != -1)
{
memset(_szImg,0,sizeof(_szImg)) ;
SQLite_GetFileName((int) _Lvi.lParam,_szImg) ;

if(lstrlen(_szImg))
{
if(PathFileExists(_szImg))
{
SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 0,(LPARAM) (LPSTR) PathFindFileName(_szImg)) ;
lstrcpy(szCurrentFile,_szImg) ;

GetImageFileProperties(szCurrentFile,&_FileSize,&_ImageSize,_szFormatName,&_ImageWidth,&_ImageHeight) ;

sprintf_s(_szTmp,sizeof(_szTmp),"W = %d / H = %d",_ImageWidth,_ImageHeight) ;
SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 1,(LPARAM) (LPSTR) _szTmp) ;

sprintf_s(_szTmp,sizeof(_szTmp),"File size = %d",_FileSize) ;
SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 2,(LPARAM) (LPSTR) _szTmp) ;

sprintf_s(_szTmp,sizeof(_szTmp),"Image size = %d",_ImageSize) ;
SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 3,(LPARAM) (LPSTR) _szTmp) ;

SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 4,(LPARAM) (LPSTR) _szFormatName) ;

InvalidateRect(hEffects,NULL,TRUE) ;
InvalidateRect(hZoom,NULL,TRUE) ;

Memory_CreateImageList(szCurrentFile) ;
RealSizeImage_CreateImageList(szCurrentFile) ;
}
}
}
}
}
else
{
if(((NMHDR *) __lParam)->code == NM_SETFOCUS)
{
if(((NMHDR *) __lParam)->idFrom == IDW_LISTVIEW)
{
memset(&_Lvi,0,sizeof(LVITEM)) ;
memset(_szTmp,0,MAX_PATH) ;

_Lvi.mask = LVIF_PARAM|LVIF_STATE|LVIF_TEXT ;
_Lvi.state = LVIS_FOCUSED|LVIS_SELECTED ;
_Lvi.stateMask = LVIS_FOCUSED|LVIS_SELECTED ;
_Lvi.pszText = _szTmp ;
_Lvi.cchTextMax = MAX_PATH ;

if(SendMessage(((NMHDR *) __lParam)->hwndFrom,LVM_GETITEM,0,(LPARAM) &_Lvi))
{
if(lstrlen(_szTmp))
{
memset(_szImg,0,sizeof(_szImg)) ;
SQLite_GetFileName((int) _Lvi.lParam,_szImg) ;

SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 0,(LPARAM) (LPSTR) PathFindFileName(_szImg)) ;
lstrcpy(szCurrentFile,_szImg) ;

SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 0,(LPARAM) (LPSTR) PathFindFileName(_szImg)) ;
lstrcpy(szCurrentFile,_szImg) ;

GetImageFileProperties(szCurrentFile,&_FileSize,&_ImageSize,_szFormatName,&_ImageWidth,&_ImageHeight) ;

sprintf_s(_szTmp,sizeof(_szTmp),"W = %d / H = %d",_ImageWidth,_ImageHeight) ;
SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 1,(LPARAM) (LPSTR) _szTmp) ;

sprintf_s(_szTmp,sizeof(_szTmp),"File size = %d",_FileSize) ;
SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 2,(LPARAM) (LPSTR) _szTmp) ;

sprintf_s(_szTmp,sizeof(_szTmp),"Image size = %d",_ImageSize) ;
SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 3,(LPARAM) (LPSTR) _szTmp) ;

SendMessage(hStatus,(UINT) SB_SETTEXT,(WPARAM)(INT) 4,(LPARAM) (LPSTR) _szFormatName) ;

InvalidateRect(hEffects,NULL,TRUE) ;
InvalidateRect(hZoom,NULL,TRUE) ;

Memory_CreateImageList(szCurrentFile) ;
RealSizeImage_CreateImageList(szCurrentFile) ;
}
}
}
}
}
}

return (0) ;
}

LRESULT ImagesToolBar_OnCreate(HWND __hWnd)
{
RECT _Rc ;
LVCOLUMN _LvCol ;

GetClientRect(__hWnd,&_Rc) ;
hLVImagesToolBar = CreateWindow(WC_LISTVIEW,szNullString,
WS_VISIBLE|WS_CHILD|LVS_ICON|LVS_SHOWSELALWAYS|LVS_SINGLESEL,
0,0,Profile.dwTumbnails_Width,_Rc.bottom,__hWnd,(HMENU) IDW_LISTVIEW_IMGTLB,hInstance,NULL) ;

memset(&_LvCol,0,sizeof(LVCOLUMN)) ;

_LvCol.mask = LVCF_WIDTH ;
_LvCol.cx = Profile.dwTumbnails_Width ;

ListView_InsertColumn(hLVImagesToolBar,0,&_LvCol) ;
_LvCol.mask = LVCF_WIDTH | LVCF_FMT ;
_LvCol.fmt = LVCFMT_IMAGE ;
ListView_InsertColumn(hLVImagesToolBar,1,&_LvCol) ;
ListView_DeleteColumn(hLVImagesToolBar,0) ;

SendMessage(hLVImagesToolBar,LVM_SETBKCOLOR,0,0) ;
SendMessage(hLVImagesToolBar,LVM_SETTEXTCOLOR,0,0x00ffff) ;

ListView_SetIconSpacing(hLVImagesToolBar,Profile.dwTumbnails_Width,Profile.dwTumbnails_Gap_Height) ;
ListView_SetExtendedListViewStyleEx(hLVImagesToolBar,LVS_SHAREIMAGELISTS | LVS_EX_BORDERSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_SIMPLESELECT,LVS_SHAREIMAGELISTS | LVS_EX_BORDERSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_SIMPLESELECT) ;
SendMessage(hLVImagesToolBar,LVM_SETOUTLINECOLOR,0,0x00ff0000) ;

return (0) ;
}

LRESULT ImagesToolBar_OnSize(DWORD __dwNewWith,DWORD __dwNewHeight)
{
MoveWindow(hLVImagesToolBar,0,0,__dwNewWith,__dwNewHeight,TRUE) ;

return (0) ;
}

LRESULT CALLBACK ImagesToolBarWndProc(HWND __hWnd,UINT __Msg,WPARAM __wParam,LPARAM __lParam)
{
switch(__Msg)
{
case WM_NOTIFY : return(ImagesToolBar_OnNotify(__lParam)) ;

case WM_SIZE : return(ImagesToolBar_OnSize(LOWORD(__lParam),HIWORD(__lParam))) ;

case WM_CREATE : return(ImagesToolBar_OnCreate(__hWnd)) ;
}

return(DefWindowProc(__hWnd,__Msg,__wParam,__lParam)) ;
}
Title: Re: Bizarre
Post by: JohnF on February 27, 2016, 09:52:07 AM
Turn optimizations off and debug it, find out where the problem occurs.

John
Title: Re: Bizarre
Post by: Grincheux on February 29, 2016, 10:58:43 AM
Yes but it is strange with one compiler it is OK and with an other one it is KO.
It is usefull to have two compilers because they don't detect the same errors.
Once MSVC does not see an error but Pelle's sees it or the inverse.
I insterted one column and used ListView_InsertItem but KO too.
I don't understand why it has not one column.
Should I use a listbox? For the same result.
I suspect a problem within the library.

I have advanced on the program but they are many problems with Pelle's that I have not resolved. That makes the program ugly.
The bug A = B - (C + D) is not yet resolved. So it's difficult to have code well compiled on the two compilers. With one I write A = B (C + D= and with the other I write E = C + D ; A = B - E ; !!!!!!!!!!!!

The other form A = B - C - D does not work too.
Title: Re: Bizarre
Post by: Grincheux on March 12, 2016, 10:36:40 AM
I have found, witf Pelle's C Compiler you can't use macros ListView_xxxx instead use SendMessage. Now with MSVC2015 and Pelle's the are same results. :P :P
Title: Re: Bizarre
Post by: frankie on March 12, 2016, 02:37:50 PM
Please create a small compilable sample.
I'll try to fix header commctrl.h
Title: Re: Bizarre
Post by: Grincheux on March 12, 2016, 05:33:29 PM
I think that is in ListView_SetIconSpacing.

You can download the 7up program here (http://www.phrio.biz/ImagesViewer/7UpImageViewer.exe)

And the web page here (http://phrio.biz/mediawiki/Images_Viewer)

The file ImageViewer.exe is the MSVC2015 version and PImageViewer.exe is Pelle's version
Title: Re: Bizarre
Post by: frankie on March 12, 2016, 06:07:53 PM
I need a minimal sample as few line of source code as you can put together to show the problem.
Title: Re: Bizarre
Post by: Grincheux on March 12, 2016, 10:46:30 PM
I did it but the only answser was John's one. Now trying to reproduce the bug is difficult. I want to tell that when I ask something ther is no answer generally, also why did I gave the answers for members that do not answers.

Take a look at macros SetIconSpacing, SetOutLineColor

SetIconSpacing is very hard to understand, when using it take care of the WM_SIZE message if you use it.

But I'll try to make what you answer. From my first post below.

There are problems with WM_CTLCOLOR_xxxxx messages
Title: Re: Bizarre
Post by: JohnF on March 13, 2016, 08:48:33 AM
Frankie,

Here's a maco with a problem in that header, I'm sure there are more.

Code: [Select]
#define ListView_GetItemRect(hwnd,i,prc,code)\
(BOOL)SNDMSG((hwnd),LVM_GETITEMRECT,(WPARAM)(int)(i),((prc)?(((RECT*)(prc))->left = (code),(LPARAM)(RECT*)(prc)):(LPARAM)(RECT*)NULL))

Had to roll my own.

Code: [Select]
#define MyListView_GetItemRect(hWnd, idx, prc, code)\
  ((RECT*)(prc))->left = code;\
  SendMessage(hWnd, (UINT)LVM_GETITEMRECT, (WPARAM)idx,(LPARAM)(RECT*)&rc)

John
Title: Re: Bizarre
Post by: TimoVJL on March 13, 2016, 09:51:18 AM
ListView_SetIconSpacing and ListView_GetItemRect macros are same as in WDDK 7
ListView_SetOutlineColor macro is missing
Code: [Select]
#define ListView_SetOutlineColor(hwnd, color) \
    (COLORREF)SNDMSG((hwnd), LVM_SETOUTLINECOLOR, (WPARAM)0, (LPARAM)(COLORREF)(color))
Title: Re: Bizarre
Post by: Grincheux on March 13, 2016, 12:32:32 PM
There is something strange in SetOutLineColor The source files are here (http://www.phrio.biz/ImagesViewer/VersionSoS/$$ImagesViewer.7z) and the binaries are here (http://www.phrio.biz/ImagesViewer/VersionSoS/7UpImageViewer.exe)

Launch PImageViewer and take a look at the border
Launch ImageViewer, there is no border

Go to tab "Layer" and compare the two combos.

I have compared with MS and Mingw I have found no differences too.

There is a mistery
Title: Re: Bizarre
Post by: Grincheux on March 13, 2016, 12:42:48 PM
I have reinstalled Pelle's, nothing change.
Title: Re: Bizarre
Post by: TimoVJL on March 13, 2016, 02:55:25 PM
This test code works same way in both compilers.
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <commctrl.h>

#ifndef ListView_SetOutlineColor
#define ListView_SetOutlineColor(hwnd, color) (COLORREF)SNDMSG((hwnd), LVM_SETOUTLINECOLOR, (WPARAM)0, (LPARAM)(COLORREF)(color))
#endif

#pragma comment(linker, \
 "\"/MANIFESTDEPENDENCY:type='Win32' "\
 "name='Microsoft.Windows.Common-Controls' "\
 "version='6.0.0.0' "\
 "processorArchitecture='*' "\
 "publicKeyToken='6595b64144ccf1df' "\
 "language='*'\"")

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
HWND MakeListView(HWND hWnd);
void Test1(HWND hWndLV);

TCHAR *szAppName = TEXT("WLV_List");
TCHAR *szFrameClass = TEXT("cWLV_List");
HWND hFrame, hWndLV;
HANDLE hInst;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX wcx;
MSG msg;

wcx.cbSize = sizeof(WNDCLASSEX);
wcx.style = CS_HREDRAW | CS_VREDRAW;
wcx.lpfnWndProc = (WNDPROC) WndProc;
wcx.cbClsExtra = 0;
wcx.cbWndExtra = 0;
wcx.hInstance = hInstance;
wcx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
wcx.hbrBackground= (HBRUSH)COLOR_3DSHADOW;
wcx.lpszMenuName = NULL;
wcx.lpszClassName= szFrameClass;
wcx.hIconSm = 0;

if (!RegisterClassEx(&wcx))
return 0;
hInst = hInstance;

hFrame = CreateWindowEx(0, szFrameClass, szAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
200, 400,
NULL, NULL, hInst, NULL);
if(!hFrame) return 0;
ShowWindow(hFrame, nCmdShow);
//UpdateWindow(hFrame);

while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg) {
case WM_SIZE:
//MoveWindow(hWndLV, 0, 0, LOWORD(lParam), HIWORD(lParam), 0);
MoveWindow(hWndLV, 0, 0, 150, HIWORD(lParam), 0);
return 0;
case WM_CREATE:
hWndLV = MakeListView(hWnd);
Test1(hWndLV);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}

HWND MakeListView(HWND hWnd) {
HWND hWndLV;
hWndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, NULL,
WS_CHILD | WS_VISIBLE | WS_TABSTOP // | LVS_REPORT
,0, 0, 1, 1,
hWnd, 0, hInst, NULL);
ListView_SetExtendedListViewStyle(hWndLV, LVS_EX_BORDERSELECT);
//SendMessage(hWndLV,LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_GRIDLINES, LVS_EX_GRIDLINES);
return hWndLV;
}

void Test1(HWND hWndLV)
{
TCHAR szTmp[] = TEXT("rowx");
LVITEM lvi;
HIMAGELIST hImgLst = ImageList_Create(100, 100, ILC_MASK, 4, 4);
ListView_SetImageList(hWndLV, hImgLst, LVSIL_NORMAL);
ListView_SetIconSpacing(hWndLV, 100, 4);
COLORREF color = 0;
ListView_SetOutlineColor(hWndLV, color);
lvi.mask = LVIF_TEXT;
for (int i = 0; i < 9; i++) {
lvi.pszText = szTmp;
lvi.iItem = i;
lvi.iSubItem = 0;
szTmp[3] = i + '1';
ListView_InsertItem(hWndLV, &lvi);
}
SetFocus(hWndLV);
}
In PImagesViewer.exe listview borders are blue indeed.
List in Zoom window is better in PellesC version than MS, as MS version have unnecessary dividing area between pics.
Window resizing don't work in both programs.
Title: Re: Bizarre
Post by: frankie on March 13, 2016, 04:44:59 PM
I have recompiled sources with pocc 8.00.60 and found no errors.
John, as Timo said, ListView_GetItemRect is the same as MSVC, and is correct. The unroll you made manually is equivalent to the comma operator in:
Code: [Select]
((prc)?(((RECT*)(prc))->left = (code),(LPARAM)(RECT*)(prc)):(LPARAM)(RECT*)NULL).
If prc is a valid pointer assigns to its left field the value of code then uses comma operator to pass prc to the send message function. If prc is invalid passes a null pointer.
Maybe the problem is in the user code due to slightly different interpretation of something, maybe user macros not parenthesized, or the like by the 2 compilers.
Title: Re: Bizarre
Post by: JohnF on March 13, 2016, 06:02:50 PM
So you are saying that all functions that get a pointer should have this provision?

Yes I know what the macro does, PellesC doesn't like it though.

John

Title: Re: Bizarre
Post by: TimoVJL on March 13, 2016, 06:33:10 PM
I like that simple macro that John prefers.
without rect pointer that macro is useless?
Code: [Select]
warning #2130: Result of comparison is constant.
Title: Re: Bizarre
Post by: frankie on March 13, 2016, 07:13:40 PM
Sorry John, I don't understand what's wrong.
Please try this code:
Code: [Select]
#include <windows.h>
#include <stdio.h>
#include <commctrl.h>
#undef SNDMSG
#define SNDMSG myfunc
BOOL myfunc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
PRECT prc = (PRECT)lParam;
printf("hwnd=%p, msg=%u, prc=%p, left=%d, wParam=%d\n", hwnd, msg, prc, prc ? prc->left : 0, wParam);
return TRUE;
}

void foo(PRECT prc)
{
//Here we don't get 'comparison constant' because prc is defined outside
ListView_GetItemRect(NULL, 10, prc,  20);
}

int main(int argn, char **args)
{
RECT rc;
//Here we got a 'comparison constant' because rc is defined here
ListView_GetItemRect(NULL, 10, &rc,  20);
ListView_GetItemRect(NULL, 10, NULL, 20);
foo(&rc);
        return 0;
}
This is a simple test for the list view macros, and as I can see it works.
Title: Re: Bizarre
Post by: frankie on March 13, 2016, 07:29:00 PM
Timo, see my updated sample that shows that the macro is correct.
The scope of the test is to avoid an exception when the user pass a null pointer. Because inside SendMessage no exception is generated, and the function simply fails, to let have an exception in the macro is to like to modify the standard behavior of SendMessage.
For these reasons the macro is correct IMHO.
About the
Quote
warning #2130: Result of comparison is constant.
message it is correct. See my code in previous post, it is generated only in the main where it is known to the compiler that rc exists. In this case the comparison is always true and the dead code, for comparison, is removed (this is the sense of the warning).
This is confirmed in the function foo where the warning is not generated because the pointer is defined outside and the camparison result is unknown at compile time.

P.S. To be noted that even on the line where we pass a NULL for rectangle pointer the compiler doesn't generate the warning. Maybe this conditional is resolved at preprocessor level?
Title: Re: Bizarre
Post by: Grincheux on March 13, 2016, 09:27:14 PM
Thank you for your research. :D
Title: Re: Bizarre
Post by: Grincheux on March 13, 2016, 09:44:50 PM
The problem comes from the manifest file. It is created by MSVC and set in ressources for Pelles. If I use the Pelle's manifest the result is the same.
Title: Re: Bizarre
Post by: frankie on March 13, 2016, 09:53:58 PM
Great!  :)
No bugs then  ;)
Title: Re: Bizarre
Post by: Grincheux on March 13, 2016, 09:56:12 PM
I try to get the manifest created by MSVC and to import it into a ressoucre for Pelle and say to MSVC that it must use the rc manifest!
Thank for your help
Title: Re: Bizarre
Post by: Grincheux on March 13, 2016, 10:13:07 PM
Here is the manifest found in ImageViewer.exe (Version MSVC)

Quote
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
</assembly>

And here is what I put in Pelle's version :

Quote
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity processorArchitecture="amd64" version="1.0.0.0" name="MyOrganization.MyDivision.MyApp" type="win32"/>
<description>Verbal description of MyApp.</description>
-<dependency>
-<dependentAssembly>
<assemblyIdentity language="*" processorArchitecture="amd64" version="6.0.0.0" name="Microsoft.Windows.Common-Controls" type="win32" publicKeyToken="6595b64144ccf1df"/>
</dependentAssembly>
</dependency>
-<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
-<application>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>

Extracted with Ressources Hacker.
Title: Re: Bizarre
Post by: TimoVJL on March 14, 2016, 08:34:35 AM
In Visual Studio 2008:
Project option -> Manifest Tool -> Input and Output -> Additional Manifest Files
Title: Re: Bizarre
Post by: Grincheux on March 14, 2016, 11:09:30 AM
That's what I already made.
But the outline color must be drawn only when I click on a image, not always.
If there is no manisfest I get my result.
Thanks

Philippe
Title: Re: Bizarre
Post by: Grincheux on March 14, 2016, 11:15:18 AM
That's what I already made.
But the outline color must be drawn only when I click on a image, not always.
If there is no manisfest I get my result.

Quote
LVS_EX_BORDERSELECT Version 4.71 and later. Changes border color when an item is selected, instead of highlighting the item.


Quote
SendMessage(hListView,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_BORDERSELECT|LVS_EX_DOUBLEBUFFER|LVS_EX_AUTOAUTOARRANGE,LVS_EX_BORDERSELECT|LVS_EX_DOUBLEBUFFER|LVS_EX_AUTOAUTOARRANGE) ;
Thanks

Philippe
Title: Re: Bizarre
Post by: Grincheux on March 14, 2016, 12:59:32 PM
You know ImageViewer than I!

I replaced the value in ImageViewer.ini and re-set the manifest for both MSVC and Pelle, all is OK.

Thank you for people who helped me without you I had not the answer to my problem.

I made a site for ImageViewer (http://ivw.phrio.biz/Accueil) but members of this forum can access source files here (http://phrio.biz/ImagesViewer/VersionSoS/$$ImagesViewer.7z).

I put the software in donationware.
Title: Re: Bizarre
Post by: Grincheux on March 14, 2016, 01:29:00 PM
The program that I wrote is not extraordinary , but it makes things that other
they do not do.
I tried to minimize the dialog boxes, there are only two , because I do not like them.
Perhaps that this software will help someone and whether he can bring me a few euros , why not.
Finally, I did not do it for the money but for the fun of programming .
I wish I have no gift for graphics, the interface would surely have been more beautiful.
I will continue to evolve , now a crazy idea is outstanding gestation ,
but I gladly accept your ideas.

Thank you , Frankie , Timo & John .

Philippe