I use a third party dll which returns information to my code in VB by way of a function in my code which I provide the dll with the address :
result = wLib.Initialize(Key, AddressOf ApiGuiCallback)
wLib is the third party dll, ApiGuiCallback is my function to receive the data from the dll.
My ApiGuiCallback Function is coded as such:
Private Function ApiGuiCallback(ByVal state As UInteger, _
ByVal msg As GuiMessage, ByVal buff As ImageInfo) As Integer
How do I code this in C# so that the dll will execute my ApiGuiCallback function upon it's completion?
Denny
Loading
Baimey RajeshPosted Feb 3, 2010, 11:23 PM
VB --- Sub TestFunc(ByVal x As Integer, ByRef y As Integer, ByRef z As Integer)
C#--- void TestFunc(int x, ref int y, out int z)
When Accept variable number of arguments...
C#----int Sum(params int[] nums)
int total = Sum(4, 3, 2, 1);
VB----Function Sum(ByVal ParamArray nums As Integer()) As Integer
Dim total As Integer = Sum(4, 3, 2, 1)
VB----AddHandler MsgArrivedEvent, AddressOf My_MsgArrivedCallback
' Won't throw an exception if obj is Nothing
RaiseEvent MsgArrivedEvent("Test message")
RemoveHandler MsgArrivedEvent, AddressOf My_MsgArrivedCallback
C#----MsgArrivedEvent += new MsgArrivedEventHandler(My_MsgArrivedEventCallback);
MsgArrivedEvent("Test message"); // Throws exception if obj is null
MsgArrivedEvent -= new MsgArrivedEventHandler(My_MsgArrivedEventCallback);
Please post back if this is not wat you want else mark if it helps