473,379 Members | 1,302 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,379 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 6660
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.