08-21-2015 06:34 AM
Hello everybody, I have a quite special problem I haven't experienced before. I hope I am not the first person to face this problem...
I have a source code writen and succesfully compiled in CVI 2009 and I am just trying to compile it in CVI 2010 as it is, before I do my modifications. The problem is that in 2010 the NM_CUSTOMDRAW defined in CommCtrl.h (and other things used in the source code) (see below) is not found by the pre-procesor because the value of _WIN32_IE is not the same as in CVI 2009. I wonder whether this _WIN32_IE is set by the compiler itself. I tried to change it in Build -> Configuration -> Manage configuration -> Edit -> Build options -> Compiler Defines by adding the sentence /D_WIN32_IE=0x0300 but then the compiler says "ilegal expresion" at the first time it evaluates _WIN32_IE in ShellAPI.h. I have the same error compiling for 64 and 32.
Any suggestions please!?
CommCtrl.h
...
#if (_WIN32_IE >= 0x0300)
#define NM_CUSTOMDRAW (NM_FIRST-12)
...
Solved! Go to Solution.
08-24-2015 07:34 AM
Hello Josete,
Which is the line that gives you errors? Is it in your code or in a headder file? Do you use NM_CUSTOMDRAW in your code?
/D_WIN32_IE=0x0300 in Compiler Defines should work. What is the line that gives you error in ShellAPI.h?
Could you please list the headers you include in a file that gives you error.
To understand how the preprocessor directives are expanded you can use the menu Options->Preprocess Source File from a source editor window.
Constantin
08-24-2015 09:40 AM
Hi Constantin, thanks for your answer,
I have cleared this specific error with the NM_CUSTOMDRAW by using the /D_WIN32_IE=0x0300 define as you said.
I have tried also setting this to 0x0400 and the compiler also recognize the NM_CUSTOMDRAW, so it compiles OK.
I couldn't check yet if the software works because I have other problems, but in case something is wrong I will come back with the analisys.
Thanks!!!