2
Answers

How to use a DLL

lsoljf

lsoljf

21y
2.4k
1
Hi I'm starting with c# now and have previouse used VB6.0. In VB I have declared the following: Declare Function Logon Lib "DBCOM" (ByVal id As String, ByVal TypeNo As Integer, ByVal NoOfArg As Integer, ArgFields As Integer, ArgValues As String) As Integer I then call the function Logon in the code, to access the logon function in the DBCOM.DLL. The code goes like this: Dim iReturnVal as integer iReturnVal = Logon("User1",3,4,3,"The args") I hope there is some smart C# brains in this forum who can help me, by telling me how I can use this Logon function placed in the DBCOM.DLL from C#. Thanks
Answers (2)
0
steven_yin

steven_yin

NA 12 0 21y
[DllImport( "filename.dll",EntryPoint="functionname")] public static extern int functionname(type parameter1,type parameter2...);
0
kovan

kovan

NA 636 0 21y
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkPlatformInvokeTutorial.asp