468,251 Members | 1,382 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,251 developers. It's quick & easy.

problem with mixing managed/unmanaged code in several assemblies

Hello,

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

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

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

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

and
//RenderAppGUI.dll

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

virtual iPlugin* plugin()
{
return _app;
}
private:
Test* _app;
};
If I load the RenderAppGUI.dll with Assembly::LoadFile and create a
TestGUI CreateInstance I get a TypeLoadException 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 1053

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by mynab | last post: by
8 posts views Thread by Nadav | last post: by
1 post views Thread by Steve Marsden | last post: by
2 posts views Thread by zamir.khan | last post: by
5 posts views Thread by achutha.sridhar | last post: by
2 posts views Thread by Jon Slaughter | last post: by
1 post views Thread by nIgHtCrAwLeR | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.