VC++6 plugin to a .NET Interface???

mooman_fl

Centurion
Joined
Nov 3, 2002
Messages
193
Location
Florida, USA
Ok... didn't know where to post this so I am putting it here. Move it if you need to.

I am currently working on a VB.NET program that will accept plugins containing GUI's. I have a friend that wants to make a plugin that would greatly enhance my program. However he only writes in VC++6. Is this even possible? A sample of my VB.NET interface is below just in case that has some bearing.

from pesi.dll:
Visual Basic:
Public Interface IPopEditorDialogPlugin
    Event PluginCreated()
    Event GUICreated()
    Event GUIDestroyed()
    Event PluginDestroyed()
    Event Callback()
    ReadOnly Property Name() As String
    ReadOnly Property Version() As String
    ReadOnly Property Creator() As String
    ReadOnly Property Description() As String
    ReadOnly Property LoadOnStartup() As String
    'This would hold the URL to an update
    'to a folder on a remote server where
    'plugin updates can be downloaded from.
    ReadOnly Property UpdateURL() As String
    ReadOnly Property FileName() As String

    Sub Intialize()
    Sub GetGUI(ByRef hostcontrol As System.Windows.Forms.Control, ByRef displaycontrol As System.Windows.Forms.Control)
    Function GetReturn() As String
    Function DestroyGUI() As Boolean
End Interface
 
If he wants to write in C++.NET, this is possible. All he has to do is make a class which implements your interface. Otherwise, no, there's not really a practical way to do this.
 
Thanks for the answer VolteFace... that is pretty much what I suspected. Got another question then:

Would it be possible then to make the same interface in VC++6 and then implement the interface in VB.NET? That might give him an acceptable reference in his plugins? How would I go about referencing that in my project (if it is even possible)?
 
Making .NET use COM plugins would be rather difficult, and making C++ use .NET plugins is near impossible. I suggest you stick with one of the two and either write both the plugins and the host in C++ using COM, or write the plugins and the host in .NET using the .NET assembly technology. C++ and .NET just won't go together in that respect.
 
Thanks again VolteFace... I knew it would be difficult to do it that way. I am trying to get him to at least switch to C#..... but haven't had much luck so far. Maybe this will help him decide.
 
Back
Top