Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Use of IOR in x64

michaelgreen1
Beginner
456 Views

Hi All,

In Win32 this works well:

iret = SendMessage(hWndList,LVM_SETEXTENDEDLISTVIEWSTYLE,0, &
ior(LVS_EX_FULLROWSELECT,LVS_EX_ONECLICKACTIVATE))

But in x64 I get warnings about the arguments to IOR.

I solve the problem by using local declarations like this:

integer(8) LVS_EX_FULLROWSELECT_I8,LVS_EX_ONECLICKACTIVATE_I8

then local assignments like this:

LVS_EX_FULLROWSELECT_I8 = LVS_EX_FULLROWSELECT
LVS_EX_ONECLICKACTIVATE_I8 = LVS_EX_ONECLICKACTIVATE

and a call like this:

iret = SendMessage(hWndList,LVM_SETEXTENDEDLISTVIEWSTYLE,0, &
ior(LVS_EX_FULLROWSELECT_I8,LVS_EX_ONECLICKACTIVATE_I8))

 

It works, but it's ugly. Is there a better way?

 

Many thanks

Mike

 

 

0 Kudos
2 Replies
andrew_4619
Honored Contributor III
428 Views
integer(flparam) :: iflgs
ifgs = ior( LVS_EX_FULLROWSELECT, LVS_EX_ONECLICKACTIVATE )
iret = SendMessage(hWndList,LVM_SETEXTENDEDLISTVIEWSTYLE, 0_fwparam, iflgs )

or

integer :: iflgs
ifgs = ior( LVS_EX_FULLROWSELECT, LVS_EX_ONECLICKACTIVATE )
iret = SendMessage(hWndList,LVM_SETEXTENDEDLISTVIEWSTYLE, 0_fwparam, int(iflgs,flparam) )

I would tend to use one of the above but without my typo's

Steve_Lionel
Honored Contributor III
416 Views

I'd do it this way:

iret = SendMessage(hWndList,LVM_SETEXTENDEDLISTVIEWSTYLE,0, &
iany([integer(fLPARAM)::LVS_EX_FULLROWSELECT,LVS_EX_ONECLICKACTIVATE]))

Note that this can be extended to as many values as needed to OR together. 

0 Kudos
Reply