473,320 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

What does this mean?

This define is from the Vista SDK from propidl.h:

#ifdef __cplusplus
#define REFPROPVARIANT const PROPVARIANT &
#else
#define REFPROPVARIANT const PROPVARIANT * __MIDL_CONST
#endif

and again in propkeydef.h:

#ifdef __cplusplus
#define REFPROPERTYKEY const PROPERTYKEY &
#else // !__cplusplus
#define REFPROPERTYKEY const PROPERTYKEY * __MIDL_CONST
#endif // __cplusplus
OK, so I know what PROPVARIANT and PROPERTYKEY are, but I'm afraid
that I don't understand what REFPROPVARIANT and REFPROPERTYKEY refers
to.
What exactly is being defined? How does REFPROPVARIANT and
REFPROPERTYKEY relate to the original PROPVARIANT and PROPERTYKEY,
respectively. I've not seen this same syntax before.

Thanks!
Brett
Dec 31 '07 #1
5 6653
On Mon, 31 Dec 2007 13:18:38 -0800, brettcclark wrote:
This define is from the Vista SDK from propidl.h:

#define REFPROPVARIANT const PROPVARIANT * __MIDL_CONST

OK, so I know what PROPVARIANT and PROPERTYKEY are, but I'm afraid that
I don't understand what REFPROPVARIANT and REFPROPERTYKEY refers to.
What exactly is being defined?
REFPROPVARIANT is being defined. Whenever the preprocessor sees
REFPROPVARIANT after that #define, it replaces it with const PROPVARIANT
* __MIDL_CONST. That's all that #define does. It works the same way for
REFPROPERTYKEY. It's a simple word replacement, without regarding context.

I have no idea what const PROPVARIANT * __MIDL_CONST is supposed to mean,
but you say you already know, so you should be able to figure out the
rest once you understand how #define works.
Dec 31 '07 #2
On Dec 31, 4:29 pm, Harald van Dk <true...@gmail.comwrote:
On Mon, 31 Dec 2007 13:18:38 -0800, brettcclark wrote:
This define is from the Vista SDK from propidl.h:
#define REFPROPVARIANT const PROPVARIANT * __MIDL_CONST
OK, so I know what PROPVARIANT and PROPERTYKEY are, but I'm afraid that
I don't understand what REFPROPVARIANT and REFPROPERTYKEY refers to.
What exactly is being defined?

REFPROPVARIANT is being defined. Whenever the preprocessor sees
REFPROPVARIANT after that #define, it replaces it with const PROPVARIANT
* __MIDL_CONST. That's all that #define does. It works the same way for
REFPROPERTYKEY. It's a simple word replacement, without regarding context.
Right, so what does this mean then?

const PROPVARIANT * __MIDL_CONST

I have no idea what const PROPVARIANT * __MIDL_CONST is supposed to mean,
but you say you already know, so you should be able to figure out the
rest once you understand how #define works.
Ahh, I understand what the structure PROPVARIANT is, but, like you, I
have
no idea what the little asterisk is for... that was the question. I
understand
what define does, but the weird const PROPVARIANT * __MIDLE_CONST
threw me
for a loop.

Thank you!
Dec 31 '07 #3
On Mon, 31 Dec 2007 13:34:07 -0800, brettcclark wrote:
Right, so what does this mean then?

const PROPVARIANT * __MIDL_CONST
>I have no idea what const PROPVARIANT * __MIDL_CONST is supposed to
mean, but you say you already know, so you should be able to figure out
the rest once you understand how #define works.

Ahh, I understand what the structure PROPVARIANT is, but, like you, I
have
no idea what the little asterisk is for... that was the question.
const PROPVARIANT * simply means "pointer to read-only PROPVARIANT".
Whether you're learning C or C++, your textbook or tutorial should cover
pointers. It's __MIDL_CONST that could be pretty much anything, possibly
a compiler-specific directive, possibly another macro, possibly something
completely different.
Dec 31 '07 #4
On 1月1日, 上午5时54分, Harald vanDijk <true...@gmail.comwrote:
On Mon, 31 Dec 2007 13:34:07 -0800, brettcclark wrote:
Right, so what does this mean then?
const PROPVARIANT * __MIDL_CONST
I have no idea what const PROPVARIANT * __MIDL_CONST is supposed to
mean, but you say you already know, so you should be able to figure out
the rest once you understand how #define works.
Ahh, I understand what the structure PROPVARIANT is, but, like you, I
have
no idea what the little asterisk is for... that was the question.

const PROPVARIANT * simply means "pointer to read-only PROPVARIANT".
Whether you're learning C or C++, your textbook or tutorial should cover
pointers. It's __MIDL_CONST that could be pretty much anything, possibly
a compiler-specific directive, possibly another macro, possibly something
completely different.
everyone's answer is good.I learn a lot,thanks.
Jan 1 '08 #5
br*********@gmail.com wrote:
OK, so I know what PROPVARIANT and PROPERTYKEY are, but I'm afraid
that I don't understand what REFPROPVARIANT and REFPROPERTYKEY refers
to.
What exactly is being defined? How does REFPROPVARIANT and
REFPROPERTYKEY relate to the original PROPVARIANT and PROPERTYKEY,
respectively. I've not seen this same syntax before.
It means that in the twenty years Microsoft has been writing C and
C++ operating system interfaces they still haven't learned from their
past mistakes. For example a typedef here would sure be a better
idea.

Of course if you don't mind stepping in all the preprocessor doodoo
that they gratuitously insert in your translation stream, I guess
it's ok.
Jan 2 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
3
by: Jukka K. Korpela | last post by:
I have noticed that the meaning of visibility: collapse has been discussed on different forums, but with no consensus on what it really means. Besides, implementations differ. The specification...
86
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that:...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
2
by: Steve Richter | last post by:
What does the "." mean in the following sql script stmts? use GO if exists (select * from dbo.sysobjects where id = object_id(N'.') and OBJECTPROPERTY(id,N'IsUserTable') = 1) drop table ....
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
51
by: jacob navia | last post by:
I would like to add at the beginning of the C tutorial I am writing a short blurb about what "types" are. I came up with the following text. Please can you comment? Did I miss something? Is...
1
by: Frank Rizzo | last post by:
Some of the classes in the framework are marked as thread-safe in the documentation. In particular the docs say the following: "Any public static (*Shared* in Visual Basic) members of this type...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
9
by: JoeC | last post by:
m_iWidth = (int)pBitmapInfo->bmiHeader.biWidth; m_iHeight = (int)pBitmapInfo->bmiHeader.biHeight; What does this mean? I have seen v=&var->member.thing; but what does it mean when you...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.