interfaces and base class problem compile error. 
Author Message
 interfaces and base class problem compile error.

I have a managed main C++ class, that has a base C++ class and interface,
when I then try to use main class in C# I get compile error "Cannot create
an instance of the abstract class or interface" or error CS0144. Yet I can
use main class perfectly OK in c++.

eg C++

public __gc class Base {}

public __interface IInterface{}

public __gc class Main: public Base, public IInterface{}

then in C#

Main main = new Main(); //Compile error see description above.

Thanks..



Sun, 18 Sep 2005 18:00:43 GMT  
 interfaces and base class problem compile error.
Just to shed a little more light on the problem, I actually have another
class which is derived from base and Interface and it compiles perfectly
under C# and C++!!!

Hmmmmm.........


Quote:
> I have a managed main C++ class, that has a base C++ class and interface,
> when I then try to use main class in c# I get compile error "Cannot create
> an instance of the abstract class or interface" or error CS0144. Yet I can
> use main class perfectly OK in c++.

> eg C++

> public __gc class Base {}

> public __interface IInterface{}

> public __gc class Main: public Base, public IInterface{}

> then in C#

> Main main = new Main(); //Compile error see description above.

> Thanks..



Sun, 18 Sep 2005 18:14:10 GMT  
 interfaces and base class problem compile error.
Could it be a namespace issue (main) ?
Quote:

> Just to shed a little more light on the problem, I actually have another
> class which is derived from base and Interface and it compiles perfectly
> under C# and C++!!!

> Hmmmmm.........



> > I have a managed main C++ class, that has a base C++ class and interface,
> > when I then try to use main class in c# I get compile error "Cannot create
> > an instance of the abstract class or interface" or error CS0144. Yet I can
> > use main class perfectly OK in c++.

> > eg C++

> > public __gc class Base {}

> > public __interface IInterface{}

> > public __gc class Main: public Base, public IInterface{}

> > then in C#

> > Main main = new Main(); //Compile error see description above.

> > Thanks..



Mon, 19 Sep 2005 03:52:40 GMT  
 interfaces and base class problem compile error.
Oops! Sorry found the problem I did not declare one of the interface
functions in the Main class.


Quote:
> I have a managed main C++ class, that has a base C++ class and interface,
> when I then try to use main class in c# I get compile error "Cannot create
> an instance of the abstract class or interface" or error CS0144. Yet I can
> use main class perfectly OK in c++.

> eg C++

> public __gc class Base {}

> public __interface IInterface{}

> public __gc class Main: public Base, public IInterface{}

> then in C#

> Main main = new Main(); //Compile error see description above.

> Thanks..



Mon, 19 Sep 2005 06:01:10 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. using non dll-interface class as base for dll-interface class

2. class class-name: base-class : interface

3. Template base class compile error

4. How to make call to base class function == a compile error (restated)

5. How make call to base class function == a compile error

6. Internal Compiler Error while deriving C# class from a MC++ class implementing a C# interface

7. abstract base class and interface

8. VS.NET IDE Interface and Base class methods

9. Protected member in a base class of a base class

10. problems creating a object of a inherited class through base class

11. Internal Compiler Error C1001 (in VC++) when compiling a Dialog based App

12. IE4 Preview2 COM interface != VC++ 5.0 native COM (#import compile error)

 

 
Powered by phpBB® Forum Software