none
Implementing an C++ DLL into VB.NET Application RRS feed

  • Question

  • Hey folks,

    I'm hanging in my translation from VB.NET 2010 to VC++ 2010. I got a Host Application which has a plugin interface using the MEF Interface. My Plugin is loading its appearance from an Interface.dll. While developing my host application, I wrote a Plugin.dll using Interface.dll which is perfectly working.

    However, now I have to translate the plugin.dll to C++ and I have no clue on how to translate the following Lines of Code:

    Interface.dll:

    Public Interface IPlugin
        Function CreateInstance( _
                ByRef pntMemory As MemoryArbiter, _
                ByRef pntMessageQueue As clsMessageQueue, _
                ByRef pntGPIO As clsGPIO, _
                ByRef pntProgramSettings As Types, _
                ByRef pntDisplayDriver As DisplayDriver _
            ) As Boolean
    
        Function DeleteInstance() As Boolean
    
        Sub Main_Loop()
        Sub ForceUnload()
        Sub Interrupt()
    End Interface

    Header of my Plugin.dll:

    Imports System.ComponentModel.Composition
    Imports System.Windows.Forms.Application
    
    Imports Plugin_Interface
    Imports SharedLibrary
    Imports SharedLibrary.DisplayDriver
    
    <Export(GetType(IPlugin))>
    Public Class cPlugin
        Implements IPlugin
    
        '.... Class functions come here

    I'd be very glad about any hint you can give me. I have no clue about how to start here?! Thank you :)

    Monday, January 20, 2014 3:59 PM

Answers

All replies

  • No one? Is it such an impossible issue?
    Monday, January 20, 2014 10:22 PM
  • Hi Nils,

    Per my understanding, this is not only converting problem. If this is pure C++/CLI for .NET, you could translate your code. But if this is the C++ for windows desktop, I think you should to learn C++, because it is a very different platform and technology.

    If you have any question about pure C++/CLI, please post thread on the following forum. https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral.

    Thank you for your understanding. Hope useful to you.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, January 21, 2014 1:44 AM
    Moderator
  • Well actually its not a pure c++ problem. As far as professionals told me, the import via MEF is also from C++/CLI possible.

    The class written in c++ just has to export the iPlugin functionalty which is defined in the iPlugin Interface class.

    For my understanding I do have to find the direct translation of the export<typeof>(iPlugin). This will define its architecture.

    Importing an Interface class and implementing its defining structure should be possible in C++.Net, doesn't it?

    Tuesday, January 21, 2014 6:18 PM
  • Hi Nils,

    I am not familiar with C++ programming, so I recommend you post thread on C++ forum to meet expert for effective response. Someone like MVP maybe know this issue. https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 22, 2014 2:33 AM
    Moderator