473,687 Members | 3,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with mixing managed/unmanaged code in several assemblies


I have problems with pointers to unmanaged classes as parameters for
virtual methods, and then overwriting the virtual methods in other

#include "../Plugin/iPlugin.h" //unmanaged plugin interface header

public __gc PluginGui : public Windows::Forms: :Form

virtual void plugin(iPlugin* p)=0;
virtual iPlugin* plugin()=0;

//RenderAppGUI.dl l

#include "../Test/Test.h" //unmanaged iPlugin interface implementation
public __gc TestGUI : public PluginGUI
virtual void plugin(iPlugin* p)
_app = dynamic_cast<Te st*>(p);

virtual iPlugin* plugin()
return _app;
Test* _app;
If I load the RenderAppGUI.dl l with Assembly::LoadF ile and create a
TestGUI CreateInstance I get a TypeLoadExcepti on because no
implementation of plugin(iPlugin* p) and plugin() are found.

I guess the problem is that with the include the unmanaged types are
defined in the assembly but are seen as different types in the two
assemblies and therefore the plugin methods in TestGUI are not the
implementation for the abstract methods in PluginGUI.

But how do I fix that ?

Nov 17 '05 #1
0 1278

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

Similar topics

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 aftwerwards 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...
by: mynab | last post by:
Hello, I am facing an issue I cannot easily solve. I am writing a non-managed C++ application that I want to be extensible using plugins. The goal is to let people write plugins in any language they want including C# (but also C++, Delphi or whatever...). The way I am doing things right now is to write a managed C++ wrapper that implements the callbacks required by the application to be recognized as a plugin and uses code written in C#...
by: Nadav | last post by:
Hi, I am writing a performence critical application, this require me to stick to unmanaged C++ as performance is much better using unmanaged C++ ( about 33% better ), Still, I am trying to avoid the usage of old style COM, my alternative is to expose my unmanaged interface through the CLI, to achieve that I have created a mixed mode DLL in which my unmanaged class are defined. When referencing the DLL just described in another mixed mode EXE...
by: Steve Marsden | last post by:
Hi All the information I had read suggested that if you had an existing C project that you wished to change to managed code all you had to do was use the /clr switch and then over time you could convert/add managed code bit by bit. I have done this on my large C project and all compiles and links OK. So far so good.
by: Ditlef | last post by:
We have a large C++ COM-based project we will migrate (slowly) to .NET. We have several basic libraries we need to wrap with C++ managed wrapper libraries. Having C++ runtime Debug/Release mixed with managed code seems to make problems for project setup. The document: Team Development with Visual Studio .NET and Visual SourceSafe http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/tdlg_ch5.asp contains...
by: zamir.khan | last post by:
Hello all, New to the groups, sorry if this the wrong forum/etiquette. I am coding a c++ application that requires the use of a timer-triggered event handler. I decided to use the timer provided in System::Timers::Timer. My understanding of the next part is not very good, as my code may reveal, but as I understand it, my application is "unmanaged C++", whereas the timer extension from the system DLL is managed. Therefore I needed to use...
by: achutha.sridhar | last post by:
I've a pretty basic question on managed code. I read through couple of.net documentation, and reached a state where I know that managed code would be run by the .Net run time and it has so and so advanantages My question is if I've a unmanaged custom dll(say a.dll) built using VC++ 6.0 and if I were to create a wrapper class in .Net(say b.dll) to invoke the unmanaged dll, will my b.dll become a managed code or still it is unmanaged? As...
by: Jon Slaughter | last post by:
How difficult is it for one to integrate unmanaged C++ into C#? I know for functions one can use DLLimport but how does one go about doing it for classes? Do I have to completely reimplement the classes in managed C++ as a wrapper to the unmanaged C++ classes or is there an easier way? Essentially what I have done is written a C++ kernel mode driver and I want to use it from my C# program. Because it requires some setup outside the...
by: nIgHtCrAwLeR | last post by:
Hi, I have a managed dll which is a wrapper for an unmanaged dll. I add a reference for managed dll in C# simple application ( A form with just a button. Managed dll gets called on button click). All this is working in the application exactly as I want it to. I also wanted to implement in ASP.Net using C# as its language. Now if I take the same managed code dll and the unmanaged dll and add reference for managed dll (exactly as above)...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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...
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();...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.