I have a VB application that calls an external dll for address verification. I need to add this code to a C# application but my conversion of the code is not being accepted.
VB6 code:
Declare Function UNZ_INIT_EX Lib "UNZDLL32.DLL" () As Long
Declare Function UNZ_TERM Lib "UNZDLL32.DLL" (ByVal hUnz As Long) As Long
Declare Function UNZ_CHECKADDRESS Lib "UNZDLL32.DLL" (ByVal hUnz As Long, ByVal Line1$, ByVal line2$, ByVal line3$, ByVal Line4$) As Long
Declare Sub UNZ_GETSTDADDRESS Lib "UNZDLL32.DLL" (ByVal hUnz As Long, ByVal szFirmName As String, ByVal szPRUrb As String, ByVal szDelLine As String, ByVal szLastLine As String)
Declare Sub UNZ_GETERRORTEXT Lib "UNZDLL32.DLL" (ByVal hUnz As Long, ByVal ErrorText As String)
Declare Function UNZ_GETMATCHCOUNT Lib "UNZDLL32.DLL" (ByVal hUnz As Long) As Long
Declare Sub UNZ_GETMATCHADDR Lib "UNZDLL32.DLL" (ByVal hUnz As Long, ByVal intItem As Integer, ByVal szFirmName As String, ByVal szPRUrb As String, ByVal szDelLine As String, ByVal szLastLine As String)
Declare Sub UNZ_GETAREACODE Lib "UNZDLL32.DLL" (ByVal hUnz As Long, ByVal szAreaCode As String)
C# code:
using System.Runtime.InteropServices;
[DllImport("unzdll32.dll", CharSet.Auto)]
And I started doing this:
public static extern long UNZ_INIT_EX();
public static extern long UNZ_TERM(long hUnz);
But, I am unable to add this DLL as a reference due to this error:
Error: A reference to ... could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.