473,626 Members | 3,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exporting a Type (Class) from a managed dll (assembly)

I am exporting a class from a managed dll created in Visual C++ 2005
Express.

In A.h header file I have
// A.h
public ref class A {};

In the same module, I create a new class to be exported which will use
A as its base class.

In B.h header file.
//B.h
#include "A.h"
public ref class B : public A {};

I then try to use class B in the same module in another class called C.
In C.h header file.
//C.h
#include "B.h"
public ref class C { B^ b; };

When trying to compile the above set of classes, I get error C3213: B:
cannot export the derived type with an assembly private base type 'A'

Thanks for the response beforehand!

Nov 17 '05 #1
2 2244
In A.h header file If I change public to private (non exportable)
// A.h
private ref class A {};

I get error C3213: B:
cannot export the derived type with an assembly private base type 'A'
Which is the error I should get.

In A.h header file When I change the private to public (exportable)
// A.h
private ref class A {};

I still get error C3213: B:
cannot export the derived type with an assembly private base type 'A'
This is not the error I should be getting

Hope some one has come across this kind of issue before, and can give
me a hint on how to resolve this problem

paul

Nov 17 '05 #2
I have made a correction to the previous post

In A.h header file If I change public to private (non exportable)
// A.h
private ref class A {};

I get error C3213: B:
cannot export the derived type with an assembly private base type 'A'

Which is the error I should get.

In A.h header file When I change the private to public (exportable)
// A.h
public ref class A {}; // not private ref class A {};

I get error C3213: B:
cannot export the derived type with an assembly private base type 'A'

This is not the error I should be getting

Hope some one has come across this kind of issue before, and can give
me a hint on how to resolve this problem

paul

Nov 17 '05 #3

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

Similar topics

6
10250
by: Stijn | last post by:
Hi there, I have the following problem. At the moment I am creating an application that interfaces with several hardware modules via USB. Each of these devices has its own functionality and I want to make this functionality available to programmers in a very generic way. Therefore I came up with the following idea. 1) USB devices can have a small description. In this description i will store the name of the DLL that covers the device...
6
1773
by: Angel | last post by:
I'm exporting (with DllImport) a C-style function with this syntax: int z9indqry (4_PARM *parm); 4_PARM is a structure declared in a proprietary header file that cannot be included in my project (due to C# limits). What would be the other best way to do this? I would like to be able to use the original struct because these structs have over 40 members each and there are several more Structs similar to 4_PARM. Also, they are modified...
0
1483
by: Niall | last post by:
I'm attempting to put a C# front end on my unmanaged C++ ray tracer code. It's still in experimental stage, as I have never done anything with exporting types from an unmanaged dll through to a managed C# dll before. Currently, I have an unmanaged dll, a managed C++ wrapper dll and a C# dll. I have managed to get enough exported from the unmanaged code to get a vaguely correct picture on the screen, however there is some odd behaviour. ...
4
1678
by: gs | last post by:
I have searched Google, MSDN,... for a week. I am still unable to make available functions in my csharp dll as native windows functions for some legacy non dotnet application I just want to expose the regex function to my old legacy application built with some tools that runs a VM with capability to access windows native DLL via declaration syntax like public int function setRegexp(String argRegexp) alias "ClassIeString.setRegexp"
2
2042
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking afterwards with ILDASM at what is visible in those assemblies from a managed point-of-view I've noticed that: 1) for each managed and unmanaged C function (not C++ classes) I get a public managed static method (defined on a 'Global Functions' class) in the generated assembly with an export name of the form
7
2619
by: Gustavo L. Fabro | last post by:
Greetings! Some classes that once compiled without problems on VS 2003 have now problems on VS 2005 Beta 1. I'm talking about a __nogc class that is exported with __declspec(dllexport). The compiler message is this: VCSelectLibraryForm.cpp ...\Forms\QiForm.h(48) : error C3395: 'TQiForm::GetDotNetMouseButton' :
5
6770
by: Jesper Schmidt | last post by:
When does CLR performs initialization of static variables in a class library? (1) when the class library is loaded (2) when a static variable is first referenced (3) when... It seems that (1) holds for unmanaged C++ code, but not for managed code. I have class library with both managed and unmanaged static variables that are not referenced by any part of the program. All the
12
7246
by: 2b|!2b==? | last post by:
I want to export my C++ classes in a DLL, using ordinal # - rather than by name. Will anyone care to enumerate through the steps required to do this? I am already failiar with exporting classes and symbols (both C++ and C) from a DLL. In the case of C functions, i also know how to export them by ordinal # - my main problem revolves around how to do the ff: 1). Obtaining the mangled names from the C++ DLL 2). How to map them (if any...
1
570
by: Saad | last post by:
Hi, I have a MC++dll, whose functions i want to use in unmanaged c++. I read that one of the ways to use the managed functions in unmanaged world is by exposing the managed api as flat api. I tried that and with simple data types it worked. But now i need to export a function which needs to take a gc struct as parameter, and then fill some values in it, and then the unmanaged c++ will use that info.
0
8196
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
8637
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...
0
7193
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...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
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();...
0
4092
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2625
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
1
1808
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
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.