This is the easiest part of the demonstration so I wont go into detail as it is pretty much self explanatory.
Private Declare Function Resolve_Name_To_Ip _ Lib "[Add the path to the dll you just compiled]" _ (ByVal pcDomainToResolve As String, _ ByVal szReturnIP As String, _ ByRef iSize As Integer) As Long Private Sub Form_Load() Dim sIP As String Dim iSize As Integer Dim lRetVal As Long Dim sDomain As String sDomain = "www.yahoo.com" sIP = String(20, "*") lRetVal = Resolve_Name_To_Ip(sDomain, sIP, iSize) MsgBox (Mid(sIP, 1, iSize)) End Sub
Well that just about wraps it up, but again, and I cannot stress it enough that if you run into trouble compiling the DLL make sure you have included the ws2_32.lib library in the project as explained above or you will get a ton of errors.
If you ever receive errors like, "error LNK2001: unresolved external symbol", you are most likely missing a required library. Just go ahead and add the missing library to the project and you will be good to go.
I hope this has helped you out!
Comments