|
May I ask which college you are attending? They are teaching a language that went out of support decades ago. I hope they are also teaching other languages as part of the course
|
|
|
|
|
Member 15558264 wrote: graduation project requires drawing in Vb 6 You have got to be joking, if not then you have basically wasted your education time on a completely useless language. It might help to name and shame the college/course teaching such rubbish.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Not So, Not So!
There are many of out here supporting Legacy systems!
ed
|
|
|
|
|
hello everyone, I have the following problem, it happens that I want to close an example application: Notepad, but the code only works for me if I have the form in the foreground if it is minized, do not close the application, I want to close the application no matter what window I am using , this is my code.
If e.KeyCode = Keys.Escape Then
KilleInventory()
End If
Private Sub KilleInventory()
Dim processesByName() As Process = Process.GetProcessesByName("Inventory")
Dim array() As Process = processesByName
For Each process As Process In array
process.Kill()
Next process
End Sub
modified 3-Mar-22 13:18pm.
|
|
|
|
|
Well one reason it's not closing Notepad is that you're calling GetProcessesByName("Inventory").
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Notepad is an example, the name of the application is called Inventory, the one I want to close
|
|
|
|
|
Use the name of the executable you're trying to stop, without the ".exe" extension.
|
|
|
|
|
hello, I see your message I was a bit sick, it happens that the code I have works but as long as I don't have the form in the foreground it doesn't close the program that I want to close, to close the program I always have to have the form in the foreground and that's it I don't want
|
|
|
|
|
One has nothing to do with the other. There's something else going on here you're not telling us about.
It does not matter if your app, or the app you want to kill, is in the foreground in order to kill the process.
|
|
|
|
|
I tell you I have a program for online connection, it runs the MAME emulator online, 3 instances open, one the main menu, the second the KAILLERA and the third the game window already executed, then when you press the ESC key the game window will close but it remains it still activates the MAME main menu window but if I go to the main form and press the ESC key it completely closes the emulator
|
|
|
|
|
What does "I have a program for online connection" mean? How does this "online" thing relate to what code is running on which machines?
|
|
|
|
|
Thank you for the time you dedicated, but I already solved the problem that it presented
|
|
|
|
|
The Process.Kill method[^] is a method of last resort. It immediately terminates the specified process without giving it a chance to clean up, and could potentially lead to system corruption.
If you want to close the application properly, you should start with the Process.CloseMainWindow method[^] instead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Why I need to write the password when I refresh a report viewer 8.5 and visual basic. Net
|
|
|
|
|
|
Hello everyone, I comment I have the following problem. It happens that I have this code where the information sent from a TCP is added, but I can't find a way to make it so that if a user leaves the application, it is removed from the listviem without having to be selected. only with the username that is in column 1
Protected Sub ActualizarTextoMensaje(ByVal sender As Object, ByVal e As System.EventArgs)
Dim HHusuario As String = "config\usuario.txt"
Dim Usuario As String
Usuario = System.IO.File.ReadAllText(HHusuario)
Dim line As String = ContenidoMensaje
Dim parts() As String = line.Split("|"c)
Dim item As New ListViewItem()
item.Text = parts(0)
If item.Text = Usuario Then
LNetgames.Items.Remove(item)
Else
For i As Integer = 1 To parts.Length - 1
item.SubItems.Add(parts(i))
Next
LNetgames.Items.Add(item)
End If
End Sub
|
|
|
|
|
You should then first Find an item having the text of "username" in column 1. Then if it was found delete the item with the found item index.
Note that there could be more than one item in your listview!
|
|
|
|
|
Hello everyone, I have the following code that works perfectly without problems When sending the data throughout the network, but I have a problem that I cannot solve And it happens that When a client executes the program, it does Not receive the data from the other clients that are are connected only receives the data When New data Is sent.
Example someone connects And In the listview the information that the other users sent Is loaded because they are online, but If another connects they cannot see that information, what I want To Do Is To wait If a client connects again this I send you the information that Is In the listview
#Region "Variables"
Dim ElSocket As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
Dim HiloRecibir As Thread
Dim Saliendo As Boolean = False
Dim DireccIP As String, ContenidoMensaje As String
#End Region
Private Sub RecibirDatos()
Do Until Saliendo
Dim LaIPRemota As New IPEndPoint(IPAddress.Any, 0)
Dim IPRecibida As EndPoint = CType(LaIPRemota, EndPoint)
Dim RecibirBytes(255) As Byte
Dim Datos As String = ""
Try
ElSocket.ReceiveFrom(RecibirBytes, RecibirBytes.Length, SocketFlags.None, IPRecibida)
Datos = Encoding.Default.GetString(RecibirBytes)
Catch ex As SocketException
If ex.ErrorCode = 10040 Then
Datos &= "[truncado]"
Else
MsgBox("Error '" & ex.ErrorCode.ToString & "' " & ex.Message, MsgBoxStyle.Critical, " Error receiving data ")
End If
End Try
LaIPRemota = CType(IPRecibida, IPEndPoint)
DireccIP = LaIPRemota.Address.ToString
ContenidoMensaje = Datos.ToString
LNetgames.Invoke(New EventHandler(AddressOf ActualizarTextoMensaje))
Loop
End Sub
Protected Sub ActualizarTextoMensaje(ByVal sender As Object, ByVal e As System.EventArgs)
Dim line As String = ContenidoMensaje
Dim parts() As String = line.Split("|"c)
Dim item As New ListViewItem()
item.Text = parts(0)
For i As Integer = 1 To parts.Length - 1
item.SubItems.Add(parts(i))
Next
LNetgames.Items.Add(item)
End Sub
Private Sub LoadSocket()
ElSocket.Bind(New IPEndPoint(IPAddress.Any, 20145))
ElSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, True)
HiloRecibir = New Thread(AddressOf RecibirDatos)
HiloRecibir.Start()
End Sub
<Obsolete>
Private Sub EnviarDatos()
Dim IpExternal = GetComputer_InternetIP()
Dim host_name As String = Dns.GetHostName()
Dim ip_address As String = Dns.GetHostByName(host_name).AddressList(0).ToString()
Dim HHusuario As String = "config\usuario.txt"
Dim Player1 As String
Player1 = System.IO.File.ReadAllText(HHusuario)
Dim DirecciónDestino As New IPEndPoint(IPAddress.Broadcast, 20145)
Dim DatosBytes As Byte() = Encoding.Default.GetBytes(LNetgames.Text)
ElSocket.SendTo(DatosBytes, DatosBytes.Length, SocketFlags.None, DirecciónDestino)
End Sub
modified 26-Jan-22 11:52am.
|
|
|
|
|
Hi Benjamin.
I did something similar to this in Visual Basic using windows functions (DLL) in those days. I called it broadcast.
However, your issue is not very difficult because those clients that are online receive your message, but anyone just connecting will not receive it after the broadcast.
What you have to do is to store and forward your messages for the clients that are offline. You can achieve this by storing your message and client ID on a database or a file for the clients that are online at the time of sending message out, then you will have a sort of service program that will forward the message later for new clients just connecting to the network.
Remember every system has a unique computer name (ID) on windows network.
When you send the message out, you keep the IDs of those online and the service program will later forward to new online clients and store their IDs too.
Note that you may also have to generate unique message ID also to filter.
|
|
|
|
|
Hello everyone, I have the following problem. It happens that I sent some data through TCP and I receive it, but it happens that this data is all added in a single column.
Public Function Rutina()
Do
If Ejecuto = True Then
Exit Do
End If
If TCP.Pending = True Then
TCPSERVERCLI.Client = TCP.AcceptSocket
End If
If TCPSERVERCLI.Connected = True Then
If TCPSERVERCLI.Available > 0 Then
Dim DataBytes(1000) As Byte
Dim decode As New ASCIIEncoding
TCPSERVERCLI.Client.Receive(DataBytes)
Me.LNetgames.Items.Add(decode.GetString(DataBytes))
End If
End If
Loop
End Function
https://i.postimg.cc/hvkHf8V7/Screenshot-1.png
|
|
|
|
|
Because that's precisely what you've told it to do!
You need to split the string and add the elements to the columns:
Dim line As String = decode.GetString(DataBytes)
Dim parts() As String = line.Split("|"c)
Dim item As New ListViewItem()
item.Text = parts(0)
For i As Integer = 1 To parts.Length - 1
item.Subitems.Add(parts(i))
Next
Me.LNetgames.Items.Add(item)
NB: According to your screenshot, your text starts with the | character. You may need to adjust the indices on the array to skip the blank first element:
item.Text = parts(1)
For i As Integer = 2 To parts.Length - 1
...
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thank you very much it helped me thank you for your help
|
|
|
|
|
Is it possible to extract information from pdf document with vb6?
Thank you very much in advance
|
|
|
|
|
VB6? Why? It's been dead for over 20 years now. If you're starting new development in VB6, you really need to rethink that.
If you insist on using it, you're going to have to do some research into finding a PDF library that is exposed through COM. I don't know of any straight away.
If you switch to VB.NET (which is FREE with the Visual Studio Community Edition!), you can use any of today's libraries, like PDFSharp.
|
|
|
|
|
Unfortunately I need it for vb6. I know the version is outdated, but it's the one I need right now. The next step is to develop in nodejs. This is now just a pilot project.
|
|
|
|