"An unhandled exception of type 'System.EntryPointNotFoundException' occurred in test_dll_1.exe
Additional information: Unable to find an entry point named 'add_1' in DLL 't1.dll'."
this is my code in C++ (header file)
__declspec(dllexport) double add_1(double a, double b); __declspec(dllexport) double sub_1(double a, double b);
the one in the main
#include "header_1.h"
double add_1(double a, double b){
return (a+b);
}
double sub_1(double a, double b){
return (a-b);
}
this code only for creating dll and I did created it correctly and i had tested it in c++ and it did works.... but in the Vb.net I had no luck with it...
This is the code that I wrote it in the VB.net
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("t1.dll")> Public Shared Function add_1(ByVal a1 As Double, ByVal a2 As Double) As Double
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = add_1(4, 3)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
End Class
and, I did put the .dll file in the bin folder, but also with no luck...
thank u very much in advance.... I hope u can help me Guys.....

New Topic/Question
Reply




MultiQuote







|