|
Hiding main form instead of closing it
|
|
|
|
|
Afternoon all
I have a while loop that is constantly receiving data at 4 times a second. Right now I convert the data and store it as a sorted list. I have to save the first data set in order to compare it to the next incoming data set and record only the key/value pairs that changed. After the comparison the most recent data has to be stored for comparison to the next data and so on and so on. Any suggestions on how i might go about doing this
Thanks in advance
|
|
|
|
|
As the lists are sorted, it's very easy to compare them. Here's some pseudo code:
input: listA, listB
indexA = 0
indexB = 0
while indexA inside listA or indexB inside listB
begin
if indexA outside listA
changed: listB(indexB)
indexB++
else if indexB outside listB
changed: listA(indexA)
indexA++
else if listA(indexA) < listB(indexB)
changed: listA(indexA)
indexA++
else if listB(indexB) < listA(indexA)
changed: listB(indexB)
indexB++
else
indexA++
indexB++
end
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks for the response
I dont really need to know how it changes just that the value changed so I was doing:
Public Sub compareit(ByVal statusList As SortedList)
Dim statusChanges As New SortedList
For listIndex = 0 To statusList.count -1
If statusList(listIndex) <> lastFrameList(listIndex) Then
statusChanges.Add(sataList.GetKey(listIndex),statusList,GetByIndex(listIndex)
End If
...here is need to save the most current statusList to be compared the next time a frame is received
Next
lastFrameList = statusList
End Sub
statusChanges should contain all the key/value pairs that changed from the previous frame
How do I initialize lastFramelist when this routine is called for the first time since there is no previous frame.
THanks again
|
|
|
|
|
captainmogo wrote:
For listIndex = 0 To statusList.count -1
That blows up if lastFrameList is shorter than statusList.
captainmogo wrote: statusChanges should contain all the key/value pairs that changed from the previous frame
If you compare them like that, you will also get a lot of items that aren't changed. If you for example add an item first in the list, statusChanges will contain all the items in the list, as the items that do match no longer have the same index.
captainmogo wrote: How do I initialize lastFramelist when this routine is called for the first time since there is no previous frame.
Just create an empty list.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello All,
Thank you for reading this post. Iam trying to build a single sign on, so that other applications in my company can be reached by just logging once. Here is how it is:
1. Lets say the site i build is called abc.com
2. I want the user to logon to abc.com, all my user info is in a SQL Server database
3.Once login is determined successful, we go to a welcome page in abc.com... From abc.com, there is a link called link1.abc.com which is a different application... here i dont want the application to ask for logon credentials again, it should give access to the user because user was validated in abc.com
4. Expanding this...how to I provide this service if i have more that 3 applications...???
My company cannot afford LDAP...all we have is a good SQL Server database, .NET 2005...what is the quickest and best way to acheive single sign on ??? Is there a free third party tool/ open source available?
Sample code, articles explaining things are very very welcome !!
Thank you
RH
|
|
|
|
|
Hi,
On the root add a config file with the following:
<authentication mode="Forms">
<forms name=".MyAppFormName"
="" loginurl="login.aspx" defaulturl="Apps/welcomepage.aspx" cookieless="AutoDetect">
/authentication
authorization
allow users="*" /
/authorization
in the protected areas (e.g. Apps) add a web.config file with the following:
authorization
deny users="?" /
/authorization
In the login form:
Check your SQL database...
IF it's OK - > FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, False)
Hope this helps
|
|
|
|
|
Has anyone worked with mapping.....I need to write a program with will show bus routes. User may and maynot have access to the internet.
What did you use, and how did you store your data....ease of use..cost...etc
Thanks
Tom Wright
tawright915@gmail.com
|
|
|
|
|
I have a device on my COM port. I need to send a string to it. What is the best way to do this? Do you have to know the port it will reside on?
|
|
|
|
|
Cory Kimble wrote: I need to send a string to it. What is the best way to do this?
Exactly what you do depends on the version of VB you're using.
Cory Kimble wrote: Do you have to know the port it will reside on?
Yes. Without it, you don't know what your sending data to.
|
|
|
|
|
I have vb .net 2003. I want to send and receive stings and packets through Com port.
|
|
|
|
|
The .NET Framework 1.1 does not come with a Serial Port class. That showed up in .NET 2.0.
Google for "vb.net 2003 serial port class[^]". There's a smattering of custom written Serial Port classes out there, but each one is different in how you use it.
|
|
|
|
|
If you want to use a serial port in .NET I strongly advice you to switch to .NET 2.0;
you would need the FrameWork itself, then an IDE (Visual Studio Express Editions
are free); both can be downloaded and installed in the matter of say 2 hours.
After that, you read up on the SerialPort class (there are some nice articles on CP about it),
choose a port (say "COM2") and you can start debugging...
|
|
|
|
|
this is refrence to the mail FARAH who asked the mouse click routines.Basically I want to make a driver for my device in which i want to simulate the mouse clicks that whenever i click (Left or Right) it performs the same functions as a normal mouse does.I want the code for the left and right clicks in VB6 plz do give me code for these routines
FARAH
-- modified at 13:40 Monday 23rd July, 2007
|
|
|
|
|
I already told you here[^]. Noone is just going to hand over the code to you. You have to write it yourself. When you get stuck with a problem with your code, then you asks specific questions about it.
To start, a little Google goes a long way. Results for "vb6 simulate mouse clicks[^]".
|
|
|
|
|
Dave Kreskowiak wrote: Noone is just going to hand over the code to you.
Nope. Will hand an invoice that he couldn't pay with the kind of money from his area. I wouldn't even accept their currency
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Paul Conrad wrote: Nope. Will hand an invoice that he couldn't pay with the kind of money from his area. I wouldn't even accept their currency
You were a "stand-up philosopher" in a previous life, weren't you? I like it!
|
|
|
|
|
Dave Kreskowiak wrote: You were a "stand-up philosopher" in a previous life, weren't you?
I keep getting the occasional flashbacks to that previous life, too
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Reasking a question in which you have already gotten the answer is bad. Telling people to hand over their code (even if you say please) is bad. Now go to the corner and read the forum guidelines.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
leckey wrote: Reasking a question in which you have already gotten the answer is bad. Telling people to hand over their code
Oh please, this is getting old. I'll hand him over code, but I will hand an invoice along with it.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I have a button, and once clicked, want it to open (and display) a pdf document. How do I go about this? Thanks.
|
|
|
|
|
You'll need a 3rd party control to load and display the PDF. Visual Basic doesn't come with anything that can do it. Google for one here[^].
|
|
|
|
|
Thanks Dave. Any recommendations? (ie, have you used one ever?)
|
|
|
|
|
Nope. I haven't had to do anything with PDF's.
|
|
|
|
|
Actually I didn't need anything 'third party' All you have to do is:
Dim acroApp As New Acrobat.Acroapp
acroApp.Show
Dim acroDoc As New AcroAVDoc
acroDoc.Open "C:\filename.pdf", ""
thanks anyway though...finding freeware controls to open pdf sure was a pain, I'm glad "this" works!
|
|
|
|