荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: tang (独孤九剑〖玄铁重剑〗), 信区: Program
标  题: [转载]  MSVC Digest - 18 Jan 1999 to 19 Jan 1999 (#1999-19)
发信站: BBS 荔园晨风站 (Wed Jan 20 17:31:08 1999), 站内信件

【 以下文字转载自 tang 的信箱 】
【 原文由 Automatic 所发表 】
There are 7 messages totalling 375 lines in this issue.

Topics of the day:

  1. Bit mask question
  2. Building strings from #defines (3)
  3. Help on CObject usage ! (3)

--------------------------------------------------------------------------
The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
international's LISTSERV(R) software.  For subscription/signoff info
and archives, see http://peach.ease.lsoft.com/archives/msvc.html .

----------------------------------------------------------------------

Date:    Tue, 19 Jan 1999 09:10:49 -0600
From:    Jeff_Nygren_AT_PO20@CCMTA-DCC_MAIL_HUB.DATACARD.COM
Subject: Re: Bit mask question

    nValue = (lParam & 0x001C) >> 2;

Select a 'mask' and shift value appropriate for the bits you want to
access.


______________________________ Reply Separator ____________________________
_____
Subject: Bit mask question
Author:  "Microsoft Visual C++ programmers list"
<MSVC@PEACH.EASE.LSOFT.COM>
(Anders W+hlin <wahlin@ERV.ERICSSON.SE>) at DATACARD
Date:    1/18/99 9:05 AM






     Hello.

     I have a LPARAM value and I need to get the value between bit 2 and 4.
      The
     bit mask looks like this:

             0110100110.....

     The value of bit 2-4 is: 5 (101).

     I know how to test each bit for its boolean value, but is there a
     function
     that can do what I want? I have created a function that seems to work,
      but
     I don't know if this is thte way to do it:

     int GetValue(LPARAM lParam, int nStartPos, int nEndPos) {
             int nCount=nStartPos, nValue;

             nValue = 2 ^ nStartPos;
             while (nCount != nEndPos) {
                     nCount++;
                     if (!(!(lParam & (1L << nCount)))) {
                             nValue += 2 ^ nCount;
                     }
             }

             return (nValue);
     }

     Can anyone please help me?

     /Anders W

     --
     Anders Wahlin
     System Manager
     IT Operations
     Ericsson Mobile Data Design AB

     Phone: +46 31 7036394
     Fax: +46 31 7036033
     E-mail: Anders.Wahlin@erv.ericsson.se

     ----------------------------------------------------------------------
     ----
     The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
     international's LISTSERV(R) software.  For subscription/signoff info
     and archives, see http://peach.ease.lsoft.com/archives/msvc.html .

------------------------------

Date:    Tue, 19 Jan 1999 16:18:36 +0000
From:    Max Walshe <Max_Walshe@BARACING.CO.UK>
Subject: Building strings from #defines

I am looking at our versioning system and looking into ways to
automate it. What I want to achieve is the component parts of
the version number(major, minor and build) to be defined as
outlined below:

#define Major    1
#define Minor    20
#define Build     32

Now I want to have string of the version number based on the
component defines, kind of:

#define  VERSION_STRING    "Major.Minor.Build"

but obviously with Major, Minor and Build substituted for their
actual values.

I'm having real problems here, I've tried stringizing and charizing
operators but all to no avail.

Has anyone any tips on how to achieve this?

Regards

Max

-----------------------------------------------------
Max Walshe                   (mwalshe@baracing.co.uk)
Senior Software Engineer

British American Racing   'A tradition of excellence'
        http://www.britishamericanracing.com

------------------------------

Date:    Tue, 19 Jan 1999 17:27:10 +0000
From:    Max Walshe <Max_Walshe@BARACING.CO.UK>
Subject: Re: Building strings from #defines

Brian,


> Does the version string have to be #define'ed??
> Maybe you could use a global (yikes)

I'm afraid so.

What we're doing is building a version resource
using the #defined values. Here's a snippet of the
resource file that we want to:

VS_VERSION_INFO VERSIONINFO
    FILEVERSION            Major,Minor,Build
    PRODUCTVERSION   ProductMajor,ProductMinor, ProductBuild

  // other version resource values etc.

BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "0409"  // US English
        VALUE "FileVersion",    VERSION_STRING  // #defined string of version
        VALUE "ProductVersion",    PRODUCT_VERSION_STRING
        // other values etc.
    END
END


So, as you can see, as this is going to go through the
resource compiler, the string version of the version
number needs to be a #define value.

Regards

Max

------------------------------

Date:    Tue, 19 Jan 1999 11:52:48 -0600
From:    Jeff_Nygren_AT_PO20@CCMTA-DCC_MAIL_HUB.DATACARD.COM
Subject: Re: Building strings from #defines

Would this work?

#define Major    "1"
#define Minor    "20"
#define Build    "32"

#define  VERSION_STRING    Major "." Minor "." Build


______________________________ Reply Separator ____________________________
_____
Subject: Re: Building strings from #defines
Author:  Max_Walshe@BARacing.co.uk (Max Walshe <Max_Walshe@BARACING.CO.UK>)
 at
DATACARD
Date:    1/19/99 5:27 PM






     Brian,


     > Does the version string have to be #define'ed??
     > Maybe you could use a global (yikes)

     I'm afraid so.

     What we're doing is building a version resource
     using the #defined values. Here's a snippet of the
     resource file that we want to:

     VS_VERSION_INFO VERSIONINFO
         FILEVERSION            Major,Minor,Build
         PRODUCTVERSION   ProductMajor,ProductMinor, ProductBuild

       // other version resource values etc.

     BEGIN
         BLOCK "StringFileInfo"
         BEGIN
             BLOCK "0409"  // US English
             VALUE "FileVersion",    VERSION_STRING  // #defined string of
             version VALUE "ProductVersion",    PRODUCT_VERSION_STRING
             // other values etc.
         END
     END


     So, as you can see, as this is going to go through the
     resource compiler, the string version of the version
     number needs to be a #define value.

     Regards

     Max

     ----------------------------------------------------------------------
     ----
     The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
     international's LISTSERV(R) software.  For subscription/signoff info
     and archives, see http://peach.ease.lsoft.com/archives/msvc.html .

------------------------------

Date:    Wed, 20 Jan 1999 00:12:08 +0530
From:    "Kameswara Rao M." <fd95522@BITS-PILANI.AC.IN>
Subject: Help on CObject usage !

Hai,

        CEquip is derived from CObject with SERIAL() macros

        My error is  " unexpected end of file while looking for an
precompiled header directive" . -- pointing the end of Equip.cpp file

        I included "Equip.h" also but invain. I beg u to get me out of
this trivial program which is paining me since a week.

        Then I removed this "Equip.h" & "Equip.cpp" and inserted directly
the code in "APPVIEW" cpp file. Then it worked fine.

        Please let me know if there r any preprocessor directives to be
included if CObject derived declarations in .h file and .cpp style
is used.

please help me ....

yours friendly,
kamesh.
                                THANK YOU
------------------------------------------------------

------------------------------

Date:    Tue, 19 Jan 1999 11:49:37 -0800
From:    "Jarvis, MitchellX" <mitchellx.jarvis@INTEL.COM>
Subject: Re: Help on CObject usage !

The error you get is usually from not including stdafx.h.

If you look at your project settings...C++ tab...Precompiled Headers
category you should see that your project uses precompiled headers. To fix
the problem just #include "stdafx.h" before everything else in your .cpp
file

-----Original Message-----
From: Kameswara Rao M. [mailto:fd95522@bits-pilani.ac.in]
Sent: Tuesday, January 19, 1999 10:42 AM
To: MSVC@PEACH.EASE.LSOFT.COM
Subject: Help on CObject usage !


Hai,

        CEquip is derived from CObject with SERIAL() macros

        My error is  " unexpected end of file while looking for an
precompiled header directive" . -- pointing the end of Equip.cpp file

        I included "Equip.h" also but invain. I beg u to get me out of
this trivial program which is paining me since a week.

        Then I removed this "Equip.h" & "Equip.cpp" and inserted directly
the code in "APPVIEW" cpp file. Then it worked fine.

        Please let me know if there r any preprocessor directives to be
included if CObject derived declarations in .h file and .cpp style
is used.

please help me ....

yours friendly,
kamesh.
                                THANK YOU
------------------------------------------------------

--------------------------------------------------------------------------
The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
international's LISTSERV(R) software.  For subscription/signoff info
and archives, see http://peach.ease.lsoft.com/archives/msvc.html .

------------------------------

Date:    Tue, 19 Jan 1999 14:56:38 -0600
From:    Jeff_Nygren_AT_PO20@CCMTA-DCC_MAIL_HUB.DATACARD.COM
Subject: Re: Help on CObject usage !

In your Equip.cpp file put #include "stdafx.h" at the top of the file.


______________________________ Reply Separator ____________________________
_____
Subject: Help on CObject usage !
Author:  "Kameswara Rao M." <fd95522@BITS-PILANI.AC.IN> at DATACARD
Date:    1/19/99 6:42 PM






     Hai,

             CEquip is derived from CObject with SERIAL() macros

             My error is  " unexpected end of file while looking for an
     precompiled header directive" . -- pointing the end of Equip.cpp file

             I included "Equip.h" also but invain. I beg u to get me out of
     this trivial program which is paining me since a week.

             Then I removed this "Equip.h" & "Equip.cpp" and inserted
     directly
     the code in "APPVIEW" cpp file. Then it worked fine.

             Please let me know if there r any preprocessor directives to
     be
     included if CObject derived declarations in .h file and .cpp style
     is used.

     please help me ....

     yours friendly,
     kamesh.
                                     THANK YOU
     ------------------------------------------------------

     ----------------------------------------------------------------------
     ----
     The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
     international's LISTSERV(R) software.  For subscription/signoff info
     and archives, see http://peach.ease.lsoft.com/archives/msvc.html .

------------------------------

End of MSVC Digest - 18 Jan 1999 to 19 Jan 1999 (#1999-19)
**********************************************************
--
※ 转载:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: 192.168.0.4]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店