|
-
Jun 28th, 2000, 12:02 PM
#1
Thread Starter
Hyperactive Member
Hi all,
The following code snippet that I am using in an ActiveX DLL gives me an error and I can't figure out why.
Private WithEvents MySock as Winsock
Private Sub Class_Initialize()
'I get an error message i.e. Error in data type
Set MySock = CreateObject("MSWinsock.Winsock")
End Sub
Private Sub Class_Terminate()
Set MySock = Nothing
End Sub
-
Jul 6th, 2000, 02:02 AM
#2
New Member
hi msdnexpert, try this.
Private WithEvents MySock as Winsock
Private Sub Class_Initialize()
'I get an error message i.e. Error in data type
Set MySock = new Winsock
End Sub
Private Sub Class_Terminate()
Set MySock = Nothing
End Sub
-
Jul 7th, 2000, 01:17 AM
#3
Thread Starter
Hyperactive Member
Hi Wolfie,
Your code also gives me an error. i.e. Invalid use of new keyword. Any other suggestions.
-
Jul 10th, 2000, 01:02 AM
#4
New Member
Hi, msdnexpert
Did you add a reference to the mswinsock.ocx?
-
Jul 11th, 2000, 06:42 AM
#5
Thread Starter
Hyperactive Member
Hi Wolfie,
Yes I did add a reference to winsock.ocx. Any suggestions.
-
Jul 11th, 2000, 07:28 AM
#6
New Member
msdnexpert,
Let's try this step by step. If this does not work, then I'm out of ideas.
Open a new project, choose activex dll.
Click on project, references, Browse and select the mswinsck.ocx.
In your declarations section type the following:
Private WithEvents mySock As MSWinsockLib.Winsock
In your class initialize event type the following :
Set mySock = New MSWinsockLib.Winsock
This works on my machine.
Warning: Do not add the control to your components.
Hope it works
Wolfie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|