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

Modifying Class Library

I've already tested this with C# and it works, but I'm being paranoid and I
wanted to also check here.

Our application has a large class library written in C++/CLI for plug-in
projects. The original library was written in C++ and the general rule for
not breaking our SDK is to not change the class size by adding member
variables and to not add virtual functions because this will change the
vtable for the class. This is fine and we know how to deal with this on the
good old native C++ side, but when it comes to the .NET class library I'm a
little confused.

It appears that I can break this rule for .NET class libraries (probably
because everything is actually in IL). Is this true that I can add virtual
functions and member variables to classes in a C++/CLI class library and not
break the functionality of assemblies that were built against the older
version of the class library?

Thanks,
-Steve

Steve Baer
Robert McNeel & Associates

Jul 3 '07 #1
4 1378
Are you using class as your interface? Why don't you extract some interface
from your class library, so you don't need to worry about memory layout and
virtual tables?

--
Sheng Jiang
Microsoft MVP in VC++
"Steve Baer" <st***@mcneel.comwrote in message
news:61**********************************@microsof t.com...
I've already tested this with C# and it works, but I'm being paranoid and
I
wanted to also check here.

Our application has a large class library written in C++/CLI for plug-in
projects. The original library was written in C++ and the general rule for
not breaking our SDK is to not change the class size by adding member
variables and to not add virtual functions because this will change the
vtable for the class. This is fine and we know how to deal with this on
the
good old native C++ side, but when it comes to the .NET class library I'm
a
little confused.

It appears that I can break this rule for .NET class libraries (probably
because everything is actually in IL). Is this true that I can add virtual
functions and member variables to classes in a C++/CLI class library and
not
break the functionality of assemblies that were built against the older
version of the class library?

Thanks,
-Steve

Steve Baer
Robert McNeel & Associates

Jul 3 '07 #2
Hi Sheng,
Yes I am using both classes and interfaces. I could have gone with the
interface route for the SDK design, but chose not to for several reasons the
primary one being that this is a wrapper around our native C++ SDK and I
wanted the code to match the native C++ style as close as possible.

Even if this was a mistake in the design of the SDK for a class library, the
class library for the initial release of our product is already out there
and being used by a large number of commercial plug-in applications. So... I
really would like to understand if adding virtual functions to classes in my
library has adverse effects on the existing plug-ins.

Thanks,
-Steve

Steve Baer
Robert McNeel & Associates

"Sheng Jiang[MVP]" <sh*********@hotmail.com.discusswrote in message
news:uQ**************@TK2MSFTNGP06.phx.gbl...
Are you using class as your interface? Why don't you extract some
interface
from your class library, so you don't need to worry about memory layout
and
virtual tables?

--
Sheng Jiang
Microsoft MVP in VC++
"Steve Baer" <st***@mcneel.comwrote in message
news:61**********************************@microsof t.com...
>I've already tested this with C# and it works, but I'm being paranoid and
I
>wanted to also check here.

Our application has a large class library written in C++/CLI for plug-in
projects. The original library was written in C++ and the general rule
for
not breaking our SDK is to not change the class size by adding member
variables and to not add virtual functions because this will change the
vtable for the class. This is fine and we know how to deal with this on
the
>good old native C++ side, but when it comes to the .NET class library I'm
a
>little confused.

It appears that I can break this rule for .NET class libraries (probably
because everything is actually in IL). Is this true that I can add
virtual
functions and member variables to classes in a C++/CLI class library and
not
>break the functionality of assemblies that were built against the older
version of the class library?

Thanks,
-Steve

Steve Baer
Robert McNeel & Associates

Jul 3 '07 #3
In .net you can extend your class and add virtual functions in a way like
..Net BCL 2.0 did to .Net 1.0. .Net 1.0 assemblies can be referenced and run
in .Net 2.0 applications.
--
Sheng Jiang
Microsoft MVP in VC++
"Steve Baer" <st***@mcneel.comwrote in message
news:51**********************************@microsof t.com...
Hi Sheng,
Yes I am using both classes and interfaces. I could have gone with the
interface route for the SDK design, but chose not to for several reasons
the
primary one being that this is a wrapper around our native C++ SDK and I
wanted the code to match the native C++ style as close as possible.

Even if this was a mistake in the design of the SDK for a class library,
the
class library for the initial release of our product is already out there
and being used by a large number of commercial plug-in applications. So...
I
really would like to understand if adding virtual functions to classes in
my
library has adverse effects on the existing plug-ins.

Thanks,
-Steve

Steve Baer
Robert McNeel & Associates

"Sheng Jiang[MVP]" <sh*********@hotmail.com.discusswrote in message
news:uQ**************@TK2MSFTNGP06.phx.gbl...
Are you using class as your interface? Why don't you extract some
interface
from your class library, so you don't need to worry about memory layout
and
virtual tables?

--
Sheng Jiang
Microsoft MVP in VC++
"Steve Baer" <st***@mcneel.comwrote in message
news:61**********************************@microsof t.com...
I've already tested this with C# and it works, but I'm being paranoid
and
I
wanted to also check here.

Our application has a large class library written in C++/CLI for
plug-in
projects. The original library was written in C++ and the general rule
for
not breaking our SDK is to not change the class size by adding member
variables and to not add virtual functions because this will change the
vtable for the class. This is fine and we know how to deal with this on
the
good old native C++ side, but when it comes to the .NET class library
I'm
a
little confused.

It appears that I can break this rule for .NET class libraries
(probably
because everything is actually in IL). Is this true that I can add
virtual
functions and member variables to classes in a C++/CLI class library
and
not
break the functionality of assemblies that were built against the older
version of the class library?

Thanks,
-Steve

Steve Baer
Robert McNeel & Associates

Jul 3 '07 #4
Thanks!

"Sheng Jiang[MVP]" <sh*********@hotmail.com.discusswrote in message
news:OQ*************@TK2MSFTNGP05.phx.gbl...
In .net you can extend your class and add virtual functions in a way like
.Net BCL 2.0 did to .Net 1.0. .Net 1.0 assemblies can be referenced and
run
in .Net 2.0 applications.
--
Sheng Jiang
Microsoft MVP in VC++
"Steve Baer" <st***@mcneel.comwrote in message
news:51**********************************@microsof t.com...
>Hi Sheng,
Yes I am using both classes and interfaces. I could have gone with the
interface route for the SDK design, but chose not to for several reasons
the
>primary one being that this is a wrapper around our native C++ SDK and I
wanted the code to match the native C++ style as close as possible.

Even if this was a mistake in the design of the SDK for a class library,
the
>class library for the initial release of our product is already out there
and being used by a large number of commercial plug-in applications.
So...
I
>really would like to understand if adding virtual functions to classes in
my
>library has adverse effects on the existing plug-ins.

Thanks,
-Steve

Steve Baer
Robert McNeel & Associates

"Sheng Jiang[MVP]" <sh*********@hotmail.com.discusswrote in message
news:uQ**************@TK2MSFTNGP06.phx.gbl...
Are you using class as your interface? Why don't you extract some
interface
from your class library, so you don't need to worry about memory layout
and
virtual tables?

--
Sheng Jiang
Microsoft MVP in VC++
"Steve Baer" <st***@mcneel.comwrote in message
news:61**********************************@microsof t.com...
I've already tested this with C# and it works, but I'm being paranoid
and
I
wanted to also check here.

Our application has a large class library written in C++/CLI for
plug-in
>projects. The original library was written in C++ and the general rule
for
not breaking our SDK is to not change the class size by adding member
variables and to not add virtual functions because this will change
the
vtable for the class. This is fine and we know how to deal with this
on
the
good old native C++ side, but when it comes to the .NET class library
I'm
a
little confused.

It appears that I can break this rule for .NET class libraries
(probably
>because everything is actually in IL). Is this true that I can add
virtual
functions and member variables to classes in a C++/CLI class library
and
not
break the functionality of assemblies that were built against the
older
version of the class library?

Thanks,
-Steve

Steve Baer
Robert McNeel & Associates

Jul 3 '07 #5

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

Similar topics

16
by: Japcuh | last post by:
How do you write self modifying code in Java? Japcuh (Just Another Perl C Unix Hacker) http://www.catb.org/~esr/faq/hacker-howto.htm#what_is ..0. ...0 000
5
by: jeffc | last post by:
Don't know what to put in the subject, because if this has a name I don't know it. You are modifying an existing application. You are not allowed to make more than minor changes. For example,...
6
by: Tim Conkling | last post by:
I'm having difficulty tracking down a bug in my program and I'm wondering if it's due to some misuse on my part of new'd objects. Here's the situation. If anyone can shed some light on this, I'd be...
4
by: VA | last post by:
I am using a JS library of functions that I include in my web page using the usual <script type="text/javascript" src=...> method Is there a way to automatically call one of my own functions...
7
by: Jan Gregor | last post by:
Hello folks I want to apply changes in my source code without stopping jython and JVM. Preferable are modifications directly to instances of classes. My application is a desktop app using swing...
4
by: Mike | last post by:
I have a web service being consume by a new client. The WebMethod they are calling is called Process. So in the WSDL I have has 2 elements, Process and ProcessResponse. <s:schema...
2
by: rk | last post by:
I have the following library.xml file coming from a system, this can't be modified. ____________________________________________________________________________ <?xml version="1.0"...
3
by: Paul | last post by:
Hello All, I am working through the SAMS "ASP.NET 2.0 - Unleased" book to teach myself ASP.NET. It is a great book, but Chapter 21 "Using ASP.NET Membership" is causing me problems - or maybe I...
6
by: Arnshea | last post by:
(apologies for the crosspost) I'm working with an MFC based COM object. From C# I'd like to be able to call a method on the COM object that takes a string array and modifies the contents. Is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.