|
-
Feb 26th, 2007, 03:33 PM
#1
Thread Starter
Lively Member
List Problem
VB Code:
Pivat Sub Test_Click()
Dim FList As String
FList = Files. ' Problem
Sock.SendData FList
End Sub
The Problem On That Is That I Want To Send The Whole List To The Other
Like If I Add Items It Sends All My Items To The Other Program And Adds It On That List
Like
As Example
Files Is The Name Of My List
Is There Any Trick For That
Thnx
-
Feb 27th, 2007, 01:01 PM
#2
Re: List Problem
What is Files? A collection? A UDT?
In any event, you'll have to either make a string out of the list and send the string, or send each item in the list, one at a time. You can't 'send' an object.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Feb 28th, 2007, 10:22 AM
#3
Thread Starter
Lively Member
Re: List Problem
Heres The Code. Its Not Ready But I Need To Fix The List Thing:
Code:
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" ( _
ByVal hwnd As Long, _
ByVal crKey As Long, _
ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2
Private Sub Close_Click()
End
End Sub
Private Sub Form_Load()
Me.BackColor = vbCyan
SetWindowLong Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED
SetLayeredWindowAttributes Me.hwnd, vbCyan, 0&, LWA_COLORKEY
USock.Close
USock.LocalPort = "3000"
USock.Listen
End Sub
Private Sub Upload_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Upload.Top = Upload.Top + 10
Upload.Left = Upload.Left + 10
End Sub
Private Sub Upload_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Upload.Top = 4820
Upload.Left = 5180
CDialog.ShowOpen
Files.AddItem CDialog.FileTitle
End Sub
Private Sub USock_ConnectionRequest(ByVal RequestID As Long)
Dim FList As String
FList = Files.List
If USock.State <> sckClosed Then USock.Close
USock.Accept RequestID
USock.SendData FList
End Sub
Thnx
-
Feb 28th, 2007, 06:10 PM
#4
Addicted Member
Re: List Problem
this line should error
FList = Files.List
Compile error:
Argument not optional
because you haven't specified an item in the list (0-based).
Last edited by kewakl; Feb 28th, 2007 at 06:14 PM.
Reason: [vbcode] is screwed up
Do not use if shrinkwrap is broken or missing!
I'm learning how to fish, too!
-
Feb 28th, 2007, 08:19 PM
#5
Thread Starter
Lively Member
Re: List Problem
Yeh But Wts The Thing That Uhm...
It Sends All Items Thats On The List ?
Thnx
-
Feb 28th, 2007, 10:35 PM
#6
Addicted Member
Re: List Problem
all i get is
Compile error:
Argument not optional
---------------------
I pasted your code and made a CONNECTing prog.
when i connect, the prog errors with the above error
message and highlights the 'FList = Files.List' line
Do not use if shrinkwrap is broken or missing!
I'm learning how to fish, too!
-
Mar 1st, 2007, 09:17 AM
#7
Thread Starter
Lively Member
Re: List Problem
Ohh
-
Mar 7th, 2007, 06:34 PM
#8
Re: List Problem
You have to loop through all the items in the list, load each file into a variable (a byte array would be best), sent the array, byte by byte, go on to the next file in the list, etc.
BTW, NEVER use End to end the program - it's like escorting your guests out the 5th floor window at the end of the party. Use Unload Me instead - that closes things that are open. (You still have to destroy your own objects.)
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Mar 7th, 2007, 07:40 PM
#9
Thread Starter
Lively Member
Re: List Problem
Oooowh I Know What You Mean Thnx And Another Thnx For The End Thing
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
|