Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Vb6 error when i complie


Daneta
 Share

Recommended Posts

```

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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?

![](http://freemmorpgmaker.com/uploadfiles/a01a02129fc239dc23571f1330fdd526.jpg)

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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...