What is the function of {{ ? 
Author Message
 What is the function of {{ ?

I'm working with VC++ 4.1 (because that's what the original code was
developed with, and because compiling it with VC6 or .NET yields
executables that behave strangely.  Also note that while I consider myself
an expert at C, I am a relative beginner in C++.

Here are three code snippets, the first two from the same file.  I know
the first is a destructor, while the second is a method, so I thought
there might be some difference in meaning.  I am fairly sure in these two,
the {{ and }} are merely decoration, but I'd like to be sure.

RgnData::~RgnData()
{{
    if (mData) free(mData);

Quote:
}}

void
RgnData::SetRect(short index, const RECT& r)
{{
    RECT*   bounds = &mData->rdh.rcBound;

    memcpy(mData->Buffer + (index * sizeof(RECT)), &r, sizeof(RECT));

    if ( (bounds->left   == 0)       &&
         (bounds->right  == 0)       &&
         (bounds->top    == 0)       &&
         (bounds->bottom == 0))
        *bounds = r;
    else
    {
        if (bounds->left   > r.left)      bounds->left = r.left;
        if (bounds->top    > r.top)       bounds->top  = r.top;
        if (bounds->right  < r.right)     bounds->right        = r.right;
        if (bounds->bottom < r.bottom)    bounds->bottom       = r.bottom;
    }

Quote:
}}

In the following example, it's my understanding that the {{ is meaningful,
even though within a comment.  Thanks in advance.

BEGIN_MESSAGE_MAP(C8PropSheet, CPropertySheet)
    //{{AFX_MSG_MAP(C8PropSheet)
        // NOTE - the ClassWizard will add and remove mapping macros here.
        //}}AFX_MSG_MAP
    ON_REGISTERED_MESSAGE(wm_SETCONTROLFOCUS, OnSetCtrlFocus)
END_MESSAGE_MAP()

--
#include <standard.disclaimer>
 _
Kevin D Quitt  USA 91351-4454           96.37% of all statistics are made up
Per the FCA, this email address may not be added to any commercial mail list



Thu, 17 Feb 2005 06:30:08 GMT  
 What is the function of {{ ?

Quote:

> I'm working with VC++ 4.1 (because that's what the original code was
> developed with, and because compiling it with VC6 or .NET yields
> executables that behave strangely.  Also note that while I consider myself
> an expert at C, I am a relative beginner in C++.

> Here are three code snippets, the first two from the same file.  I know
> the first is a destructor, while the second is a method, so I thought
> there might be some difference in meaning.  I am fairly sure in these two,
> the {{ and }} are merely decoration, but I'd like to be sure.

> RgnData::~RgnData()
> {{
>     if (mData) free(mData);
> }}

> void
> RgnData::SetRect(short index, const RECT& r)
> {{
>     RECT*   bounds = &mData->rdh.rcBound;

>     memcpy(mData->Buffer + (index * sizeof(RECT)), &r, sizeof(RECT));

>     if ( (bounds->left   == 0)  &&
>          (bounds->right  == 0)  &&
>          (bounds->top    == 0)  &&
>          (bounds->bottom == 0))
>         *bounds = r;
>     else
>     {
>         if (bounds->left   > r.left)    bounds->left    = r.left;
>         if (bounds->top    > r.top)     bounds->top     = r.top;
>         if (bounds->right  < r.right)   bounds->right   = r.right;
>         if (bounds->bottom < r.bottom)  bounds->bottom  = r.bottom;
>     }
> }}

> In the following example, it's my understanding that the {{ is meaningful,
> even though within a comment.  Thanks in advance.

> BEGIN_MESSAGE_MAP(C8PropSheet, CPropertySheet)
>     //{{AFX_MSG_MAP(C8PropSheet)
>         // NOTE - the ClassWizard will add and remove mapping macros here.
>         //}}AFX_MSG_MAP
>     ON_REGISTERED_MESSAGE(wm_SETCONTROLFOCUS, OnSetCtrlFocus)
> END_MESSAGE_MAP()

> --
> #include <standard.disclaimer>
>  _
> Kevin D Quitt  USA 91351-4454           96.37% of all statistics are made up
> Per the FCA, this email address may not be added to any commercial mail list

The first two cases are certainly decoration and not usually seen.
The class wizard related case is used by the wizard (an automated code
writer) when it searches for its private territory within the code.
Don't touch!  The wizard portions are managed indirectly via the IDE.

--
Scott McPhillips [VC++ MVP]



Thu, 17 Feb 2005 07:44:50 GMT  
 What is the function of {{ ?


Quote:
>The first two cases are certainly decoration and not usually seen.
>The class wizard related case is used by the wizard (an automated code
>writer) when it searches for its private territory within the code.
>Don't touch!  The wizard portions are managed indirectly via the IDE.

Thanks.  There was a mix of {{ and { within the same file, and while I was
pretty sure, I wasn't completely sure.

--
#include <standard.disclaimer>
 _
Kevin D Quitt  USA 91351-4454           96.37% of all statistics are made up
Per the FCA, this email address may not be added to any commercial mail list



Sun, 20 Feb 2005 00:36:14 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Why I am getting Error C2091: function returns function

2. I am new to programming and am lost

3. Macro with functions problem -- why am I stupid?

4. What function am I in?

5. how good am I? Am I Good Enough????

6. Call a function in a function with name of a function as parameter

7. functions, functions, and more functions!

8. How to use (pointer to function), and function and pointer to (pointer to function)

9. Determine where I am running

10. System.Threading.Timer , am I doing this correctly ?

11. Am i connected?

12. Request - Opinions on Book I am considering:

 

 
Powered by phpBB® Forum Software