473,769 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mixing Old/New Syntax?

We have developed a big library using managed C++. The project started
with .NET 1.0 and has been ported to .NET 1.1. Today we ship the library
compiled for .NET 1.1 and 2.0.

At the moment the whole code uses the "old" managed C++ syntax.
Due to the amount of code and the need of supporting .NET 1.1 it is
not possible for us to port the complete code to the new CLI/C++
syntax.

We would like to use the new Generics. We have written a Generic
class using the new syntax. After setting the property of this class in
the IDE to CLI/C++ is is possible to compile this class in the same project
as the other classes still using the old syntax.

But afterwards the real problem occurs. How can we use this new class
in classes, which are still using the old syntax? Including the header file
of the new class into old classes does not work (due to the mixture of
the new and the old syntax).

Is it possible to tell the compiler, which syntax a header files uses
(e.g. with a pragma)?

cu, Marco
Dec 6 '06 #1
5 1720
...
We would like to use the new Generics. We have written a Generic
class using the new syntax. After setting the property of this class in
the IDE to CLI/C++ is is possible to compile this class in the same
project
as the other classes still using the old syntax.

But afterwards the real problem occurs. How can we use this new class
in classes, which are still using the old syntax? Including the header
file
of the new class into old classes does not work (due to the mixture of
the new and the old syntax).

Is it possible to tell the compiler, which syntax a header files uses
(e.g. with a pragma)?
If you shall separate new and old syntax classes into different assemblies,
you will be able to import that assemblies without having to include header
files. This will resolve the problem.

--
Vladimir Nesterovsky
Dec 6 '06 #2
Hi,
If you shall separate new and old syntax classes into different
assemblies, you will be able to import that assemblies without having to
include header files. This will resolve the problem.
I know. But as a result I need all classes in one assembly. Is this not
possible?

cu, Marco

Dec 6 '06 #3
We would like to use the new Generics. We have written a Generic
class using the new syntax. After setting the property of this class in
the IDE to CLI/C++ is is possible to compile this class in the same
project
as the other classes still using the old syntax.
Generics are a feature of .NET 2.0 and the new syntax.
Old syntax has no concept of generics, so whether you put your CLI classes
in another assembly, or simply mix old and new syntax in 1 project doesn't
matter.
Old syntax has no room for using generics.

--

Kind regards,
Bruno van Dooren
br************* *********@hotma il.com
Remove only "_nos_pam"
Dec 6 '06 #4
"Budde, Marco" <mb*******@linu xhaven.dewrote in message
news:eX******** ******@TK2MSFTN GP03.phx.gbl...
>If you shall separate new and old syntax classes into different
assemblies, you will be able to import that assemblies without having to
include header files. This will resolve the problem.

I know. But as a result I need all classes in one assembly. Is this not
possible?
That's a good question. I wonder if it is possible to create a netmodule
from the classes that use the old syntax and then to link that netmodule
with one that contains the new classes to form a complete assembly:

http://msdn2.microsoft.com/en-us/library/k669k83h.aspx

Regards,
Will
Dec 6 '06 #5
Hi Bruno,
Generics are a feature of .NET 2.0 and the new syntax.
Old syntax has no concept of generics, so whether you put your CLI classes
in another assembly, or simply mix old and new syntax in 1 project doesn't
matter.
Old syntax has no room for using generics.
I have not problems creating instances of existing generic classes
using the old syntax, e.g.:

System::Collect ions::Generic:: List<Value* *values;

There seems to be only one problem: using generic classes, which have
been defined in the same project using the new syntax.

cu, Marco

Dec 7 '06 #6

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

Similar topics

3
3477
by: bergel | last post by:
Hello, Does anyone already have some experience in mixing AWT and Swing? Is it conceptually doable? Does the design of Swing prevent interaction between an AWT and a Swing widget? Regards, Alexandre
6
4909
by: Russell E. Owen | last post by:
At one time, mixing for x in file and readline was dangerous. For example: for line in file: # read some lines from a file, then break nextline = readline() # bad would not do what a naive user might expect because the file iterator buffered data and readline did not read from that buffer. Hence the call to readline might unexpectedly skip some lines.
0
1829
by: Erik Max Francis | last post by:
Is there any prohibition against mixing different protocols within the same pickle? I don't see anything about this in the Python Library Reference and, after all, the pickle.dump function takes a protocol argument for each time it's called. (This is in Python 2.3.3.) I have a pickle containing two objects: a tag string and a (large) object containing many children. The identifying string is there so that you can unpickle it and...
1
1545
by: Robert Brewer | last post by:
> > > Can we insert conditional expressions in the > decorator list ? > > > > Not with the current patch; however, that option may be > allowed in the future. > > "In the future" means "post-2.4, when we have an idea of what people > are doing with it". Right now, there's not a whole lot of use cases > for more complex expressions in the decorator area, and there's more > potential for horror. Guido made this call on a gut...
3
3720
by: Tim Knauf | last post by:
Hi everyone, I'm glad to have found this list. I've written a small script for my own use which, amongst other things, captures mouse click information from a window containing an image. I used Pygame to manage the image window, as it was the easiest way to implement the functionality I needed. The surrounding interface windows (there are two) are constructed with Tkinter. Despite their unholy union, Pygame and Tkinter seem, generally,...
4
23690
by: Rudolf | last post by:
Is it possible to add a vb.net source code module to a c# project and if so how? Thanks Rudolf
1
285
by: womanontheinside | last post by:
I have a library which was written in C, you call a function, it provides the result by a callback to specific function names. I am trying to wrap the calls to this inside a class, but this causes a problem with the callbacks, for example: class X { public: add(); };
28
3095
by: ziman137 | last post by:
Hello all, I have a question and am seeking for some advice. I am currently working to implement an algorithmic library. Because the performance is the most important factor in later applications, I decide to write it in C instead of C++. However, I thought it might be convenient to use some C++ code at some misc places. I'm aware that, I could always use the C++ compiler to get it work.
2
2316
by: kelvin.koogan | last post by:
Our company has a mix of users with VS2003 & VS2005. I'm am having difficulty working out how components written with these 2 tools can be written together. I want to be able to a) incorporate a C++/CLI DLL written in VS2005 into a managed extensions app written with VS2003 and b) use a managed extensions DLL written with VS2003 in a C++/CLI app written in VS2005. How can I do this? Immediate problems I found:
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.