LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Project link error: Undefined simbols with TreeView macros

Solved!
Go to solution

Hi everyone,

 

I'm facing a problem "Project link error - Undefined simbol" with the TreeView macros TreeView_GetCheckState() and TreeView_GetCheckState() , that I use in my project. When I compiled it in 2009 it worked but now that I have to compiled for later update in 2010 it does not work.

 

Info about these macros in https://msdn.microsoft.com/en-us/library/windows/desktop/bb773810(v=vs.85).aspx

 

These macros are supposed to be defined in ComCtl32.lib. I think that since it is a WINAPI it is automatically included in the project but I have this compilation error. I have included it to my project by hand and I can see it now in my project tree but the same error persist. I have the #include commctrl.h.

 

Does anybody know what  am I doing wrong that my project cannot find these functions?

 

 

0 Kudos
Message 1 of 2
(3,820 Views)
Solution
Accepted by topic author josete

Hi again,

 

I found out that this macros are defined in CommCtrl.h and they are dependent of _WIN32_IE, so I have written in the Compiler Defines options /D_WIN32_IE=0x0500 and now the compiler take these macros into account and therefore the problem is gone. For some reason the value of _WIN32_IE is not the same in my compiler in CVI2009 and in CVI2010.... 

 

#if (_WIN32_IE >= 0x0500)
// tvm_?etitemstate only uses mask, state and stateMask.
// so unicode or ansi is irrelevant.
#define TreeView_SetItemState(hwndTV, hti, data, _mask) \
{ TVITEM _ms_TVi;\
_ms_TVi.mask = TVIF_STATE; \
_ms_TVi.hItem = (hti); \
_ms_TVi.stateMask = (_mask);\
_ms_TVi.state = (data);\
SNDMSG((hwndTV), TVM_SETITEM, 0, (LPARAM)(TV_ITEM *)&_ms_TVi);\
}

#define TreeView_SetCheckState(hwndTV, hti, fCheck) \
TreeView_SetItemState(hwndTV, hti, INDEXTOSTATEIMAGEMASK((fCheck)?2:1), TVIS_STATEIMAGEMASK)

#define TVM_GETITEMSTATE (TV_FIRST + 39)
#define TreeView_GetItemState(hwndTV, hti, mask) \
(UINT)SNDMSG((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), (LPARAM)(mask))

#define TreeView_GetCheckState(hwndTV, hti) \
((((UINT)(SNDMSG((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), TVIS_STATEIMAGEMASK))) >> 12) -1)

.....

0 Kudos
Message 2 of 2
(3,809 Views)