Vb6 error when i complie


Sub SendData(ByRef data() As Byte)

Dim Buffer As clsBuffer

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

If IsConnected Then

	 Set Buffer = New clsBuffer

	 Buffer.WriteLong (UBound(data) - LBound(data)) + 1

	 Buffer.WriteBytes data()

	 frmMain.Socket.SendData Buffer.ToArray()

End If

' Error handler

Exit Sub

errorhandler:

HandleError "SendData", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

ok when i complie it i get this error it says method or data members not found to the word .socket

You need a winsock named Socket in your frmMain. Double-check that its name is Socket. It must have 0-TCP as the socket type.

Have you changed your frmMain?

i went in the file and saw this it said frmmain but it was a notepad file it said

Line 46: Cannot load control Socket; license not found. why

frmmasin? Make sure it’s titled frmMain. It probably is - but jeez man, take an extra minute to type properly.

In this case, I’m guessing the license is not found because you are using an incomplete version of VB6. Which version of the VB6 IDE do you have installed? You need either VB6 Enterprise or VB6 Pro. Free, trial, or portable will not cut it.

idk what i have

Look at what the loader says when you first run VB6. There should be a white box with some text.

If you’re still at a loss, look under help-> about and read after VBA:

when i post tjis in modgraphics

Public Sub DrawHair(ByVal x2 As Long, ByVal y2 As Long, ByVal Hair As Long, ByVal Anim As Long, ByVal spritetop As Long, ByVal tint As Long)

Dim rec As RECT

If Hair < 1 Or Hair > NumHairs Then Exit Sub

With rec

.Top = spritetop * (Tex_Hair(Hair).Height / 4)

.Bottom = .Top + (Tex_Hair(Hair).Height / 4)

.Left = Anim * (Tex_Hair(Hair).Width / 4)

.Right = .Left + (Tex_Hair(Hair).Width / 4)

End With

’ Clip to screen

If y2 < 0 Then

With rec

.Top = .Top - y2

End With

y2 = 0

End If

If x2 < 0 Then

With rec

.Left = .Left - x2

End With

x2 = 0

End If

'RenderTexture Tex_Hair(Hair), ConvertMapX(x2), ConvertMapY(y2), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Width, rec.Height

RenderTexture Tex_Hair(Hair), ConvertMapX(x2), ConvertMapY(y2), rec.Left, rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, rec.Right - rec.Left, rec.Bottom - rec.Top, tint

End Sub

and i try to complie

i get this error ambiguous name detected: draw hair

now i get that

Do not post the same question in multiple threads. You probably have two subs named DrawHair.

ok i posted another error i got on the tut thread

Although you got them after following the tutorial, your errors aren’t really relevant to the tutorial. I know this because they involve things which the tutorial doesn’t even touch. You should post them here.

now i get this


' connect

frmMain.Socket.RemoteHost = Options.IP

frmMain.Socket.RemotePort = Options.Port

were it says socket.remotehost is were i cet the complie error it says method or data member not found why is it because of the vb6 im using

When you go to type frmMain.Socket.Remote into the IDE, does anything pop up?

If nothing pops up, you are missing a winsock named Socket in frmMain.

If you see something like above, there is no error in your code or forms. Rather, you are using an improper version of the VB6.0 IDE and will have to download either the enterprise or professional version. Do not get the trial, free, or portable versions. Go for Visual Studio 6.0, Visual Basic 6.0 Enterprise, or Visual Basic 6.0 Professional.

well i will try it later because my vb6 isint loading and should i just get a new vb6


Sub TcpInit()

    ' If debug mode, handle error then exit out

    If Options.Debug = 1 Then On Error GoTo errorhandler

    Set PlayerBuffer = New clsBuffer

    ' connect

    frmMain.Socket.RemoteHost = Options.IP

    frmMain.Socket.RemotePort = Options.Port

    ' Error handler

    Exit Sub

errorhandler:

    HandleError "TcpInit", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext

    Err.Clear

    Exit Sub

End Sub

and theres the full code maby its something in there

The “full code” would involve anything and everything to do with frmMain.Socket. Anyway, doesn’t really matter. Think about this: you haven’t touched that bit of code and it’s been working for hundreds, if not thousands, of other people. So, no, it’s not something in there. It’s your inadequate VB6 IDE. It won’t even load? Get a proper version.

I didn’t read through the entire topic, so forgive me if this has already been stated.

  • Install the run times again.
  • Try to manually register mswinsck.ocx
  • Go back to frmMain.
  • Find the socket control.
  • Delete it.
  • Add a new one and name it Socket.
  • Save it and Recompile.
Log in to reply