Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Howto call a VB.NET DLL method from C++.NET

kolbertkolbert Member Posts: 1
Hi,

has anyone a solution howto call a method from a VB.NET DLL in a C++-application?
My VB-DLL is like this:
______________________________________________________________
Namespace Ns_BLib
Public Class BasicClass1
Inherits System.ComponentModel.Component

#Region " Vom Component Designer generierter Code "
#End Region

Private CallingCount As Long = 0
Public Function BasicClass1_getInt() As Integer
Me.CallingCount += 1
Return CallingCount
End Function
End Class
End Namespace
______________________________________________________________

My c++ code is like this:
______________________________________________________________
imports BLib;
using namespace System::Runtime::InteropServices;
// for DllImportAttribute
namespace BL
{
[DllImport("BLib.dll", EntryPoint = "BasicClass1::BasicClass1_getInt", CharSet = Unicode)]
int BasicClass1_getInt(void);
}

void test (void)
{
int i = BL::BasicClass1_getInt();
}
______________________________________________________________

This results to a System.EntryPointNotFoundException.
Entry point 'BasicClass1::BasicClass1_getInt' not found in DLL BLib.dll.

Thanks.

Comments

  • blueeyesblueblueeyesblue Member Posts: 10
    : Hi,
    :
    : has anyone a solution howto call a method from a VB.NET DLL in a C++-application?
    : This results to a System.EntryPointNotFoundException.
    : Entry point 'BasicClass1::BasicClass1_getInt' not found in DLL BLib.dll.
    :
    : Thanks.
    :
    :


    I did the same job like you. But I failed. I just imported the DLL by the ClassWizard in VC.NET. I have no idea that it said couldnt found type lib in the file ClassLibrary1.dll. What's wrong?
    == blueeyesblue ==

Sign In or Register to comment.