I am having problems referencing a C++ DLL from my .Net App. Everything works fine onthe machine that I build the app but if I try to run the app on a different machine I get an error:
Could not load file or assembly 'AClassLib'.
I've simplified the app and DLL down to 2 functions. What am I missing?
vb Code:
Imports AClassLib Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Dim ACL As AClassLib.Class1 = New AClassLib.Class1 Dim ACL As New AClassLib.Class1 Dim a As Double Dim b As Double Dim c As Double a = TextBox1.Text b = TextBox2.Text Try c = ACL.AddEm(a, b) Catch ex As Exception MessageBox.Show("Button1_Click: " & ex.Message.ToString) End Try lblAnswer.Text = c End Sub End Class
Code:#include "stdafx.h" #include "AClassLib.h" namespace AClassLib { double Class1::AddEm(double A, double B) { return A + B; } }




Reply With Quote