Re: Modifying Class Library



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" <steve@xxxxxxxxxx> wrote in message
news:51451F5E-AF7E-45FC-9470-1B5CF72972CC@xxxxxxxxxxxxxxxx
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]" <sheng_jiang@xxxxxxxxxxxxxxxxxxx> wrote in message
news:uQMmKIZvHHA.4332@xxxxxxxxxxxxxxxxxxxxxxx
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" <steve@xxxxxxxxxx> wrote in message
news:61F40D1B-72B7-40B6-94C2-F6C37B286AB1@xxxxxxxxxxxxxxxx
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






.



Relevant Pages

  • Re: Modifying Class Library
    ... 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. ... I really would like to understand if adding virtual functions to classes in my library has adverse effects on the existing plug-ins. ... It appears that I can break this rule for .NET class libraries (probably ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Modifying Class Library
    ... Are you using class as your interface? ... variables and to not add virtual functions because this will change the ... It appears that I can break this rule for .NET class libraries (probably ... functions and member variables to classes in a C++/CLI class library and ...
    (microsoft.public.dotnet.languages.vc)