p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_components thread: RE: whois component wont work on system without - visual studio?


Message #1 by "Pablo Javier Rios" <prios@p...> on Mon, 27 May 2002 19:31:50
I had the same problem.

How did you solve it (without installing de IDE and applying de VB 
Component License Fixer) ?

What's behind this problem ?

Thank you very much !

> How are you trying to deploy the dll?
> 
> -----Original Message-----
> From: dont worry [mailto:aspmailbox@y...]
> Sent: Thursday, July 12, 2001 9:09 PM
> To: ASP components
> Subject: [asp_components] whois component wont work on system without
> visual studio?
> 
> 
> I have the following vb code that is a whois
> component.  THe dll seems to only work on server with
> visual studio installed on it.  I've put the code
> below, if you can fix it to work on server without
> visual studio that would be great!
> 
> ' THIS CODE AND INFORMATION IS PROVIDED "AS IS"
> WITHOUT
> ' WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
> ' INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
> ' OF MERCHANTABILITY AND/OR FITNESS FOR A  PARTICULAR
> ' PURPOSE.
> 
> ' Copyright 2000. All rights reserved.
> ' Lewis Moten
> ' http://www.lewismoten.com/
> ' email: lewis@m...
> 
> Option Explicit
> 
> Private WithEvents mObjWinsock As MSWinsockLib.Winsock
> 
> Private mStrWhoisServerAddress As String
> Private mLngWhoisServerPort As Long
> Private mBolRemoveCopyright As Boolean
> Private mStrEndCopyright As String
> Private mStrWhois As String
> Private mBolDone As Boolean
> Private mDtmStart As Date
> Private mStrAvailableString As String
> Private mLngTimeout As Long
> Private mStrDomain As String
> 
> Public Property Get AvailableString() As Variant
>     
>     AvailableString = mStrAvailableString
>     
> End Property
> 
> Public Property Let AvailableString(ByRef
> pStrAvailable)
>     
>     mStrAvailableString = pStrAvailable
>     
> End Property
> 
> Public Property Get EndCopyright() As Variant
>     
>     EndCopyright = mStrEndCopyright
> 
> End Property
> 
> Public Property Let EndCopyright(ByRef pStrEndText As
> Variant)
>     
>     mStrEndCopyright = pStrEndText
>     
> End Property
> 
> Public Property Get IsAvailable() As Variant
> 
>     IsAvailable = Not InStr(1, mStrWhois,
> mStrAvailableString, vbTextCompare) = 0
> 
> End Property
> 
> Public Sub Query(ByRef pStrDomain As Variant)
>     
>     mStrWhois = ""
>     mBolDone = False
>     mDtmStart = Now()
>     mStrDomain = pStrDomain
>     
>     mObjWinsock.Connect mStrWhoisServerAddress,
> mLngWhoisServerPort
>     
>     While Not mBolDone And DateDiff("s", mDtmStart,
> Now()) < mLngTimeout
>         DoEvents
>     Wend
>     
>     mObjWinsock.Close
>     
> End Sub
> 
> Public Property Get RemoveCopyright() As Variant
>     
>     RemoveCopyright = mBolRemoveCopyright
> 
> End Property
> 
> Public Property Let RemoveCopyright(ByRef pBolRemove
> As Variant)
>     
>     mBolRemoveCopyright = pBolRemove
> 
> End Property
> 
> Public Property Get Timeout() As Variant
>     
>     Timeout = mLngTimeout
> 
> End Property
> 
> Public Property Let Timeout(ByRef pLngSeconds As
> Variant)
>     
>     mLngTimeout = pLngSeconds
> 
> End Property
> 
> Public Property Get Whois() As Variant
>     
>     Dim lLngCopyStart
>     
>     If RemoveCopyright Then
>         
>         lLngCopyStart = InStr(1, mStrWhois,
> mStrEndCopyright, vbTextCompare)
>         
>         If lLngCopyStart = 0 Then
>             Whois = mStrWhois
>         Else
>             Whois = Mid(mStrWhois, lLngCopyStart +
> Len(mStrEndCopyright))
>         End If
>     
>     Else
>         
>         Whois = mStrWhois
>     
>     End If
>     
> End Property
> 
> Public Property Get WhoisHtml() As Variant
>     
>     WhoisHtml = "<PRE>" & Whois & "</PRE>"
> 
> End Property
> 
> Public Property Get WhoisServerAddress() As Variant
>     
>     WhoisServerAddress = mStrWhoisServerAddress
> 
> End Property
> 
> Public Property Let WhoisServerAddress(ByRef
> pStrAddress As Variant)
>     
>     mStrWhoisServerAddress = pStrAddress
> 
> End Property
> 
> Public Property Get WhoisServerPort() As Variant
>     
>     WhoisServerPort = mLngWhoisServerPort
> 
> End Property
> 
> Public Property Let WhoisServerPort(ByRef pLngPort As
> Variant)
>     
>     mLngWhoisServerPort = pLngPort
> 
> End Property
> 
> Private Sub Class_Initialize()
>     
>     Set mObjWinsock = New MSWinsockLib.Winsock
>     
>     mStrWhoisServerAddress 
> "whois.networksolutions.com"
>     mLngWhoisServerPort = 43
>     mBolRemoveCopyright = False
>     mStrEndCopyright = "policy."
>     mStrWhois = "[Error: You must query for the domain
> first]"
>     mBolDone = True
>     mLngTimeout = 10
>     mStrAvailableString = "no match"
>     
> End Sub
> 
> Private Sub Class_Terminate()
>     
>     Set mObjWinsock = Nothing
> 
> End Sub
> 
> Private Sub mObjWinsock_Close()
>     
>     mBolDone = True
>     mStrWhois = mStrWhois
> 
> End Sub
> 
> Private Sub mObjWinsock_Connect()
>     
>     mObjWinsock.SendData mStrDomain & vbCrLf
> 
> End Sub
> 
> Private Sub mObjWinsock_DataArrival(ByVal bytesTotal
> As Long)
>     
>     Dim lStrData As String
>     
>     mObjWinsock.GetData lStrData, vbString
>     
>     If Not mStrWhois = "" Then mStrWhois = mStrWhois &
> vbCrLf
>     
>     mStrWhois = mStrWhois & lStrData
>     
> End Sub
Message #2 by "Adrian Forbes" <adrian.forbes@n...> on Tue, 28 May 2002 08:37:15 +0100
> Private WithEvents mObjWinsock As MSWinsockLib.Winsock

Windows does not come with the Winsock control installed.  Make a small EXE
with a FORM that has the control on it and make a set-up for it using P&DW.
Run that set-up on any computer you want to install the DLL on


  Return to Index