Hi, I'm trying to use a .DLL which Callbacks a Function of my project, but I can't get it to work.
Declaration from .h file of .DLL
Declaration in my Mainform ClassCode:void DLL_EXPORT SetEntity_CallBack(bool Active, _ void (*Entity_Callback)(int Site, int Application, int ID, _ char* Name, int scope, int Change));
The Sub that is CalledBack is declared as follows:Code:Public Delegate Sub DelEntityCallBack(ByVal Site As Integer, _ ByVal Application As Integer, ByVal ID As Integer, _ ByRef Name As String, ByVal Scope as Integer, _ ByVal Change As Integer) <DllImport("DIS_LIB.DLL", EntryPoint:="SetEntity_Callback", _ SetLastError:=True, CharSet:=CharSet.Ansi, ExactSpelling:=True, _ CallingConvention:=CallingConvention.Cdecl)> _ Public Shared Sub SetEntity_CallBack(ByVal Active As Boolean, ByRef CallBackAddr as DelEntityCallBack) End Sub
and the DLL-code gets called like:Code:Public Sub ExternEntity_Update (ByVal Site As Integer, _ ByVal Application As Integer, ByVal ID As Integer, _ ByRef Name As String, ByVal Scope as Integer, _ ByVal Change As Integer) ... .... End Sub
When trying to run the code I get an "EntryPointNotFoundExecption" for the EntryPoint "SetEntity_Callback".Code:SetEntity_CallBack(True, AddressOf ExternEntity_Update)




Reply With Quote