|
Thanks for your response. How can I achieve this your suggestion please?
|
|
|
|
|
Investigate the Google Maps API
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Thank you so much for your time of response. Please, I tried reading about google's map api but not getting the flow. It only shows the country as a whole. But what am looking for is, assuming a pc position was lat 30.001 and log. 40.687 and was later shifted from initial position to another. I want the software to update it self with the pc current position. Please help. Once again, thanks.
modified 4-Jul-17 1:26am.
|
|
|
|
|
And how is that software supposed to know when the PC has been moved, or to figure out exactly where it is on the surface of the earth? As has already been mentioned, unless the PC contains a GPS receiver then you cannot do it.
|
|
|
|
|
The script posted by me connects to Google Map API and retrieves someone current lat. and log. but it is written in JavaScript.Looking for a way to convert it to VB (VB 6.0 or VB.Net). Any help please.
|
|
|
|
|
OK, but Google Maps API does't magically know with any REAL accuracy where the machine is UNLESS IT HAS A GPS RECEIVER. Without that YOU have to tell Google where the machine is. If you rely on any other detection machanism, like Geomapping an IP, it can be off by dozens of miles. Right now, if I don't tell Google explicitly, it'll guess that my machine is 36 miles from where it really is.
|
|
|
|
|
Thanks for your vital information!
|
|
|
|
|
How many times do we need to explain: if you do not have a GPS receiver in the PC no software can find its location. Google maps will only tell you the location of the IP address of your broadband provider. In my case that is some 70 miles from where I live.
|
|
|
|
|
There are many ways that you can do this, first and foremost has been shared with you through the use of GPS hardware. That will detect the location, and you can then write the program to get the location and show it or process it.
However, if you need to get the location of a machine inside the office or a building, you can also possibly use the network interfaces, to determine where the machine is at the moment. Note that, this is very bad in cases where you need to pinpoint location, but changes can be detected easily based on the network or the endpoint from where the machine is communication.
And as for Visual Basic, which one? The VB 6? I am unsure, whether you will be able find any solution for that, C++ or C# or Java might do some help in these cases. Even Vb.NET would require some help from C# world.
Have a look here, monitoring - Is it possible to find a computer's physical location in a room? - Server Fault
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Thanks for your vital information!
|
|
|
|
|
Here is my code, I am trying to return EmpDetails.
Structure Employee
Dim EName As String
Dim ESalary As String
End Structure
Dim EmpDetails() As Employee
Function EMPInfo(ByVal names As String()) As String()
Dim i AS Integer
Select Case nameses(i)
Case "ABC"
EmpDetails(i - 1)EName = "Dave"
EmpDetails(i - 1).ESalary = "30,000"
Case "SPE"
EmpDetails(i - 1).EName = "Eva"
EmpDetails(i - 1).ESalary = "40,000"
Case "P,SIGM"
EmpDetails(i - 1).EName = "Steve"
EmpDetails(i - 1).ESalary = "70,000"
End Select
Next
Return EmpDetails
I am getting the error for the return EmpDetails
Error: Value of type '1-dimensional array cannot be converted to '1-dimensional array of String'
What I am doing wrong in here.
Thanks in advance.
|
|
|
|
|
Shouldn't the function return Employee() ?
Try it.
|
|
|
|
|
I tried to return Employee(), But I still get error saying: Employee is a type cannot be used as an expression.
|
|
|
|
|
As David points out above, your function is defined to take an array of Strings and return a String. But inside it you are trying to manipulate an Employee structure. You also have an index which is never initialised so that will most likely crash your code. And even if it is initialised you are subtracting 1 from it which may also cause a crash.
|
|
|
|
|
Appreciate your suggestion. I am adding some new feature to the existing code, I have not typed full code in here and I don't want to change any existing code.
I just highlighted the concept(code) where I am going wrong. Is anything wrong in function declaration?
|
|
|
|
|
Member 13017730 wrote: s anything wrong in function declaration? Yes, everything, as I already told you.
|
|
|
|
|
Hello,
this might be a dummy question, but I couldn't find a good answer on the internet yet.
In my code I populate a CheckedListBox with the filenames of a particular filetype. If one of the entries gets checked ('ItemCheck' event of the CheckedListBox), I create an instance of a class that represents one of the relevant files.
If ctrl.GetItemCheckState(ctrl.SelectedIndex) = 0 Then
' create a new cfgFile class AND add it to the classes list
ff = New cfgFile(ctrl.SelectedItem)
lbl_FileMessage.Text &= ff.Message
Else
' How to dispose of the correct instance?
End if
How can I properly dispose of the correct classes' instance, once the item is unchecked again? I thought about looping through the instances and check for their 'filename' property... but there doesn't seem to be a collection of instances, which I can refer to in a loop.
Thank you for your advice,
Mick
|
|
|
|
|
Where are you holding the created instances and how are they referenced to a particular line in the list box?
|
|
|
|
|
Hi Michael,
I guess that's part of my question...
I tried to put every newly created class into a List(of class), where I could add/remove entries. But removing elements from the list (i.e. list.count resulted in -1) didn't dispose of their instances (static counter variable, decremented inside the 'dispose' method, stayed the same).
Thank you for guiding me further.
|
|
|
|
|
Would that be a probable solution?
Public Class cfgFiles
Inherits SortedList(Of String, cfgFile)
Private Shared files As New SortedList(Of String, cfgFile)
Public Overloads Shared Sub Add(ByVal fileName As String)
files.Add(fileName, New cfgFile(fileName))
End Sub
Public Overloads Shared Sub Remove(ByVal fileName As String)
Dim ff As cfgFile = files(fileName)
ff.Dispose()
files.Remove(fileName)
End Sub
Public Overloads Function GetEnumerator() As IEnumerator(Of cfgFile)
Return files.GetEnumerator
End Function
Public Property SelectedItem As cfgFile
Default Public Overloads Property Item(index As Integer)
Get
SelectedItem = files(index)
Return SelectedItem
End Get
Set(value) ' as cfgFile?
files(index) = value
End Set
End Property
End Class
|
|
|
|
|
Memory allocated in .NET using the new command can automatically claimed by the GC as soon as the object loses scope. I say can, because it won't do it immediatly. Disposing is only required if there are unmanaged resources owned by the object.
Which means you can safely remove the "ff.Dispose()" statement.
Also see Object.Finalize Method (System)[^], Garbage Collection[^] and Implementing a Dispose Method[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you for this insight, Eddy. Still I am confused having the list.count variable reduced after removing the list entry (which is an instance), but the instance itself seems to be still alive (shared counter variable of the class doesn't decrement).
|
|
|
|
|
That is because it still is alive. It will remain so until the GC collects it. You can't "force" it to be deleted from memory.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hello sir/mam
i am asking about visual basic 6.0 server client connection so please help me a i facing the problem.
i already make a tetris game and run properly but i want to connect my game to play 3 client through server.
you know the flow of a computer game hop?? it's like that the server is the one who can play the client are player1, and player2,and soon they are connecting using winsock.
how to connect my game to winsock please help me this is my project submission.
|
|
|
|
|