Multiple #defines in WinError.h
- From: jon <jon_d_r@xxxxxxx>
- Date: Fri, 27 Jul 2007 13:27:21 -0700
I am binding into the Win32 API from another language. I can't link
with the header files, but must make my own definition modules. I'm
using the MSVS.NET\Vc7\PlatformSDK\Include\WinError.h file to obtain
some values for
HRESULT definitions. I see two separate definitions for E_INVALIDARG
line 17213:
#define E_INVALIDARG
_HRESULT_TYPEDEF_(0x80070057L)
and line 17295:
#define E_INVALIDARG
_HRESULT_TYPEDEF_(0x80000003L)
So far as I can see, these both are within bounds of the same #ifdef
section (recheck: yes, they are). My modules use a named constant for
this definition, and it is substituted at compile time. The languages
with which I'm familiar allow only one value for a named constant, so
I'm confused as to which value is operational here.
As I understand the preprocessor it should make the substitutions
sequentially. The token E_INVALIDARG gets replaced in the code by the
first value _HRESULT_TYPEDEF_(0x80070057L). Then the second #define
comes up and any occurance of E_INVALIDARG would get replaced by the
second value _HRESULT_TYPEDEF_(0x80000003L), except that there should
now be no occurances of E_INVALIDARG in the code anymore, they should
have been replaced by the prior #define. So, if my interpretation of
the preprocessor is correct, the second #define has no effect. Why
then are there multiple #define's in the header file? Is this a
programmer mistake? Or is my understanding of the preprocessor not
correct?
Any help is greatly appreciated. I stand humbled in deference to the
superior knowlege of others. Please be gentle if I've used incorrect
terminolgy, but I believe even the dullest individual can see what I
mean.
thanks in advance
--
jondr
.
- Follow-Ups:
- Re: Multiple #defines in WinError.h
- From: jon
- Re: Multiple #defines in WinError.h
- Prev by Date: Choosing a PL - What you can do or how you do it?
- Next by Date: Re: Multiple #defines in WinError.h
- Previous by thread: Choosing a PL - What you can do or how you do it?
- Next by thread: Re: Multiple #defines in WinError.h
- Index(es):
Relevant Pages
|