visual-c++-6

Problem with Macros

半腔热情 提交于 2019-11-26 23:24:11
问题 HI , Can some one help me in understanding why the value of SQUARE(x) is 49 ? I am using Visual C++ 6.0 . #define SQUARE(X) X * X int main(int argc, char* argv[]) { int y = 5; printf("%d\n",SQUARE(++y)); return 0; } 回答1: Neil Butterworth, Mark and Pavel are right. SQUARE(++y) expands to ++y * ++y, which increments twice the value of y. Another problem you could encounter: SQUARE(a + b) expands to a + b * a + b which is not (a+b)*(a+b) but a + (b * a) + b. You should take care of adding

Upgraded MFC application still looks old

那年仲夏 提交于 2019-11-26 21:41:01
问题 I have an MFC application written with VC6. I have upgraded it to VS2015 and it builds and runs. The application is a main exe with many DLL's that have dialogs in them. However the application still looks like it is built with VC6. None of the GUI components have the Windows 7 look and feel, they all still look old style. How can I make my existing application look more modern? 回答1: You should at least add this line to your project, for example add it to stdafx.h #pragma comment(linker,"\"

How can adding code to a loop make it faster?

隐身守侯 提交于 2019-11-26 18:27:45
问题 I have a simple function with an inner loop - it scales the input value, looks up an output value in a lookup table, and copies it to the destination. (ftol_ambient is a trick I copied from the web for fast conversion of float to int). for (i = 0; i < iCount; ++i) { iScaled = ftol_ambient(*pSource * PRECISION3); if (iScaled <= 0) *pDestination = 0; else if (iScaled >= PRECISION3) *pDestination = 255; else { iSRGB = FloatToSRGBTable3[iScaled]; *pDestination = iSRGB; } pSource++; pDestination++

Link to all Visual Studio $ variables

ぐ巨炮叔叔 提交于 2019-11-26 10:08:21
问题 I was having a look at $(Configuration) , $(ProjectDir) etc. in Visual Studio 2008 for Prebuild events. Is there a link to all of these variables with a definition for each one of them? 回答1: Try this MSDN page: Macros for Build Commands and Properties 回答2: While there does not appear to be one complete list, the following may also be helpful: How to use Environment properties: http://msdn.microsoft.com/en-us/library/ms171459.aspx MSBuild reserved properties: http://msdn.microsoft.com/en-us

Precompiled Headers

风格不统一 提交于 2019-11-26 09:26:11
问题 I have a sample project (not mine) which is in Visual C++ 6. I\'m trying to convert it to Visual Studio 2008. The older project is using precompiled headers. Now the questions are: What are precompiled headers? Since the older project is using precompiled headers. I\'ll also use them in Visual Studio 2008 (the new project). But I get errors saying that \"Did you forget to include stdafx.h\" , to remedy the problem, I include \"stdafx.h\" in every source file. That worked perfectly. But the