473,465 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem inheriting managed C++ from C#

Hi.

I have an interface written in managed C++. I try to implement the interface
in C#. I try to override the function, but the compiler says no suitable
function can be found to override. If I remove this function the compiler
complains that it is not implemented. The code is below. I can implement the
interface both from within the original assembl and from a managed C++
assembly. Any ideas about what might be going on?

The c++ code:

#pragma once

#include "ProfileWrapper.h"
#include "ProfileSlab.h"
using namespace System;
namespace ReflectometryModelNative
{
public interface class IProfileConverter
{
public:
System::Int32 ConvertProfile(System::Int32 originalProfile);

};
}
the c# code:

public class MockProfileConverter :
ReflectometryModelNative.IProfileConverter
{
public MockProfileConverter()
{
}
public override int ConvertProfile(int a)
{
return a;
}
}


Jan 30 '06 #1
2 1050

never mind. Pleaae delete this. I was making a simple mistake in the C# code.
Jan 30 '06 #2
I have the same problem with you, but a bit differenet.

look my code:
C++:
using namespace System;

namespace CodeLibrary
{
public __gc class Class1Specify
{
// TODO: Add your methods for this class here.
};

public __gc __interface IPRo{
void dis();
};
}

C#:
public class CodeLibrarySub : CodeLibrary.IPRo
{
public void dis()
{
Console.Write("skdf");
}
}

your interface define does not work in my project, but I know its
correct from MSDN, confused:(!

Feb 9 '06 #3

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

Similar topics

1
by: john diss | last post by:
hello there everyone.. I have created a class called "ProcessLog" inheriting from XmlDocument and two classes ("UploadedItem", "ProcessError") inheriting from XmlElement. I then have two...
3
by: YYZ | last post by:
I'm new to VB.net, but not new to OO in general, and I'm very strong in VB6. However, I don't know what I did in VB.net to cause this to happen. I've got 2 projects open at the same time, in the...
3
by: Peter Plumber | last post by:
Hi, I am just a (maybe) beginner in .NET having some basic questions about the limits. I suppose easy to answer for someone already using it ... what are the limits of inheritance?
3
by: guy | last post by:
I have a problem with a class hierarchy. The inheriting and inherited class are in different solutions. In the base class, (which inherits from System.Windows.Forms.UserControl) i have a method...
3
by: Buddy Ackerman | last post by:
I bought the source code for an app and was modifying it however instead of modifying the code directly I renamed a class and then created a new class with the old name and inhertied the odl (now...
7
by: Amu | last post by:
Hi i am stuck up in a part of project where i have to inherit the VC++ template classes into C#.net. Please provide me the solution for this .
1
by: =?Utf-8?B?a2Fu?= | last post by:
hi, Consider i have built a UserControl say 'ColorMixer' in proj 'Step1'(Windows Control Proj). Now when create another proj 'Step2' as Windows Control and try adding 'ColorMixer' as inherited...
8
by: JDavis | last post by:
I am using System.Net.Sockets to connect a client socket to a server that requires three inputs when I connect: host, port and an identification number that identifies the person connecting. ...
7
by: Jeffrey Barish | last post by:
(Pdb) myclass MyClass( 0, 0, 'A string', 123.45) (Pdb) copy.copy(myclass) *** TypeError: TypeError('__new__() takes at least 4 arguments (2 given)',) I see 4 arguments (actually, 5 because...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.