C++/VB - How to get calculation eveluated at preprocessor
Asked By Angela Yan
12-Mar-10 01:14 AM
Hi everyone,
I got a following issue.
The output of the RESULT_STRING will be "Result is (3 * 10 * 10)" instead of
Anyone has any idea how to make the output to "Result is 300"??
Any help will be greatly appreciated.
ps. The value of M_NUM is generated during build time, so I cannot calculated
the value of ABC first and directly insert it into the string..
Thank you very much.
Cheers,
Angela
SpecialBuild
(1)
OfPreprocessor
(1)
Boekelheide
(1)
GeneratesM
(1)
Providenza
(1)
BuildNot
(1)
Preprocessor
(1)
Directives
(1)
Igor Tandetnik replied to Angela Yan
instead of
Preprocessor does not do math (well, it does, but only in #if =
directives). it is a text manipulation engine.
--=20
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not =
necessarily a good idea. It is hard to be sure where they are going to =
land, and it could be dangerous sitting under them as they fly overhead. =
-- RFC 1925
Tim Roberts replied to Angela Yan
Unless you really do just need to add two zeros, the only solution to this
is to use sprintf.
CString sz;
sz.Format( "Result is %d", ABC );
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Angela Yan replied to Tim Roberts
Thanks Igor and Tim..
hmm.. Actually I need
And the resulted string is used in a RC file to show the "Special build
description":
VALUE "SpecialBuild", RESULT_STRING
So I guess.. does it mean there is no way to do it??
Thank you very much.
Angela
Igor Tandetnik replied to Angela Yan
build
Not with the preprocessor, no. I suppose the same build process that =
generated M_NUM could also be made to generate ABC.
--=20
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not =
necessarily a good idea. It is hard to be sure where they are going to =
land, and it could be dangerous sitting under them as they fly overhead. =
-- RFC 1925
Angela Yan replied to Igor Tandetnik
hmm.. I do not have the source code of the build process which generates
M_NUM..
hmm.. maybe I write my own process to do the calculation and add the string
during build time..
or.. maybe I can live with the fact that just show the M_NUM on the file and
let people to do the calculation themselves.. haa...
Thank you for both Igor and Tim..
Have a nice day~~
Angela
Not with the preprocessor, no. I suppose the same build process that
generated M_NUM could also be made to generate ABC.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not necessarily
a good idea. It is hard to be sure where they are going to land, and it
could be dangerous sitting under them as they fly overhead. -- RFC 1925
filter ("drop 4 out of 5") available for download? - - Tim Roberts, timr@probo.com Providenza & Boekelheide, Inc. Win32 DirectX Video Discussions CTransInPlaceFilter (1) Boekelheide (1) Providenza (1) Timr (1) On Fri, 14 Sep 2007 21:28:36 -0700, Tim filter (drop 4 out of 5) available for download - - Tim Roberts, timr@probo.com Providenza & Boekelheide, Inc.?
events per time change. Is there any significance to this? Thanks - - HLS Win32 Kernel Discussions Boekelheide (1) Providenza (1) TIMECHANGE (1) Timr (1) HLS (1) I doubt it. Could be date then time, could be before then after. - - Tim Roberts, timr@probo.com Providenza & Boekelheide, Inc. keywords: WM_TIMECHANGE, Message, Event description: I am receiving two WM_TIMECHANGE message events per time
there any notification for the same. Thanks Aparna Win32 Kernel Discussions Windows XP (1) Providenza Boekelheide Inc (1) Button (1) Tim Roberts (1) Power (1) No, because that phrase can mean Some of those things can be detected, some cannot. - - Tim Roberts, timr@probo.com Providenza & Boekelheide, Inc. e r I want the state if monitor is ON / OFF. You must not to figure out EXACTLY what you want to know. - - Tim Roberts, timr@probo.com Providenza & Boekelheide, Inc. the y or g. ant Let me explain . . . Right click-> properties-> screen saver tab http: / / msdn.microsoft.com / en-us / library / aa373195.aspx - - Tim Roberts, timr@probo.com Providenza & Boekelheide, Inc. Thank you for the reply but RegisterPowerSettingNotification is supported only on vista, I want