473,326 Members | 2,255 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,326 software developers and data experts.

How to ignore new C++ (2005) keywords that are used in existing unmanaged C++

I have a library that's a mixed mode dll and compiles fine in in VS2005 with
/clr:oldSyntax. However, if I change it to /clr so I can use the newer
syntax it won't compile because the header files I'm including have invalid
syntax, i.e. the word generic is used for parameter names. I tried wrapping
the include with #pragma unmanaged but to no avail. Is there a way I can
compile this file and have it use /clr:OldSyntax just for that included
section? Optionally is there a way for me to extern the unmanaged class
definition so that it's made available at link time instead of compile time?
That way I could possible not include the broken header at all.
Thanks

Brian
May 16 '06 #1
3 978
why not rename name of the parameter in order to avoid confliction?
you can also try to define generic to something else, eg

#define generic param_generic
#include "xxx.h"
#undefine generic

"Brian Richards" <br*******@gmail.com> wrote in message
news:eF**************@TK2MSFTNGP03.phx.gbl...
I have a library that's a mixed mode dll and compiles fine in in VS2005
with
/clr:oldSyntax. However, if I change it to /clr so I can use the newer
syntax it won't compile because the header files I'm including have
invalid
syntax, i.e. the word generic is used for parameter names. I tried
wrapping
the include with #pragma unmanaged but to no avail. Is there a way I can
compile this file and have it use /clr:OldSyntax just for that included
section? Optionally is there a way for me to extern the unmanaged class
definition so that it's made available at link time instead of compile
time?
That way I could possible not include the broken header at all.
Thanks

Brian

May 17 '06 #2
I'm not renaming because I don't own the headers that I'm including. I'll
try the #define trick though
<www.fruitfruit.com> wrote in message
news:eJ**************@TK2MSFTNGP02.phx.gbl...
why not rename name of the parameter in order to avoid confliction?
you can also try to define generic to something else, eg

#define generic param_generic
#include "xxx.h"
#undefine generic

"Brian Richards" <br*******@gmail.com> wrote in message
news:eF**************@TK2MSFTNGP03.phx.gbl...
I have a library that's a mixed mode dll and compiles fine in in VS2005
with
/clr:oldSyntax. However, if I change it to /clr so I can use the newer
syntax it won't compile because the header files I'm including have
invalid
syntax, i.e. the word generic is used for parameter names. I tried
wrapping
the include with #pragma unmanaged but to no avail. Is there a way I can
compile this file and have it use /clr:OldSyntax just for that included
section? Optionally is there a way for me to extern the unmanaged class
definition so that it's made available at link time instead of compile
time?
That way I could possible not include the broken header at all.
Thanks

Brian


May 17 '06 #3
Thanks the #define trick worked.
<www.fruitfruit.com> wrote in message
news:eJ**************@TK2MSFTNGP02.phx.gbl...
why not rename name of the parameter in order to avoid confliction?
you can also try to define generic to something else, eg

#define generic param_generic
#include "xxx.h"
#undefine generic

"Brian Richards" <br*******@gmail.com> wrote in message
news:eF**************@TK2MSFTNGP03.phx.gbl...
I have a library that's a mixed mode dll and compiles fine in in VS2005
with
/clr:oldSyntax. However, if I change it to /clr so I can use the newer
syntax it won't compile because the header files I'm including have
invalid
syntax, i.e. the word generic is used for parameter names. I tried
wrapping
the include with #pragma unmanaged but to no avail. Is there a way I can
compile this file and have it use /clr:OldSyntax just for that included
section? Optionally is there a way for me to extern the unmanaged class
definition so that it's made available at link time instead of compile
time?
That way I could possible not include the broken header at all.
Thanks

Brian


May 18 '06 #4

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

Similar topics

22
by: edgrsprj | last post by:
PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT Posted July 11, 2005 My main earthquake forecasting Web page is: http://www.freewebz.com/eq-forecasting/Data.html ...
0
by: mscotto | last post by:
OSS 2005 The First International Conference on Open Source Systems Genova, July 11 - 15, 2005 CALL FOR PAPER http://oss2005.case.unibz.it Submissions of papers or of extended abstracts are...
6
by: MNF | last post by:
Hi everyone, I am using document.getElementById function in JavaScript to find a control within an html body, but instead I get back META item, because incidently the name of one meta tags is the...
2
by: joye | last post by:
Hello, My question is how to use C# to call the existing libraries containing unmanaged C++ classes directly, but not use C# or managed C++ wrappers unmanaged C++ classes? Does anyone know how...
11
by: Mark Broadbent | last post by:
This post is not intended in inflame, so please provide only positive or informative replies. Personally I'm getting a little fed up over certain changes to Framework classes and such -whereby...
7
by: Gustavo L. Fabro | last post by:
Greetings! Some classes that once compiled without problems on VS 2003 have now problems on VS 2005 Beta 1. I'm talking about a __nogc class that is exported with __declspec(dllexport). The...
6
by: Olaf Baeyens | last post by:
The new Visual C++ 2005 is coming out in a theater near you. :-) Just a few questions: * How will the users that use my program upgrade to the .NET framework 2.0? My current users already refuse...
10
by: mkausalya | last post by:
hai experts can know about the use of far & near keywords in c lang
7
by: Maximus Decimus | last post by:
HI all, I am using python v2.5 and I am an amateur working on python. I am extending python for my research work and would like some help and guidance w.r.t this matter from you experienced...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.