|
Hi
I am using VB 6.0. I am working on an application involving Com port.
I need to send messages to com port continously and when I recieve data from the other end i need to perform another action. So I should put the data to be sent in a queue and when I recieve response from the other end I should remove first element in the queue and process that.
using queues is an appropriate one. I can't use .NET now. In .NET it's very simple using System.Collections.Queue.
Thanks in advance
|
|
|
|
|
Member 3057887 wrote: I am using VB 6.0.
Why would you do such a thing ? Have you lost a bet ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hi
Thanks for replying so soon
I did not bet at all. The application is already developed in Vb 6.0. To convert it into .NET it takes some time. But we dont have much time as we have demo tomorow.
|
|
|
|
|
There is no threading support in VB6. For a workaround (if you port your app to .NET later) I would try something with a timer control, that pools your serial. Thats NOT good practice, but probably a quick and dirty way...
Regards: Didi
|
|
|
|
|
I'm trying to do the same. All I need is how to implement queues in vb 6.0. Is there any way like System.Collections.Queue in .NET. I want to put all the messages to be sent into a queue. when the comport receives response from the other end I will take out the first element in the queue and use that.
regards
|
|
|
|
|
There is no explcit queue. You could use an array instead.
Good luck with your demo tomorow: Didi
|
|
|
|
|
Hi
thanks a lot. array size is fixed. if i use redim it is intializing every time. the code should be in such a way that when the timer fires
the msg to be sent should be appended to the list of previous msgs.
regards
|
|
|
|
|
...use ReDim Preserve and it will not reinitialze. Regards: Didi
|
|
|
|
|
ReDim Preserve is a painful solution, the memory usage is nasty as you need to have allocated both the old and new memory at the same time.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Yes, you are right, but we were talking about a dirty easy solution to save a presetation appointment tomorow. The guy is going to port the solution to .NET later. I never saied that this is good programming practice.
Regards: Didi
|
|
|
|
|
I've seen so much 'quick and dirty for a demo' go into production code that I avoid it like the plague.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
There are collections in VB6, try:
Option Explicit
Private queue As Collection
Private Sub Class_Initialize()
Set queue = New Collection
End Sub
Public Sub Enqueue(newItem As String)
queue.Add newItem
End Sub
Public Function Dequeue() As String
Dim ret As String
ret = queue.item(1)
queue.Remove 1
Dequeue = ret
End Function
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Zing!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hello All,
I have a question about Antivirus. How the antivirus work. how the antivirus check this exe have these function which can effect on data.
Because Exe is created in Encoded form.
Thanks
If you can think then I Can.
|
|
|
|
|
eg_Anubhava wrote: Because Exe is created in Encoded form.
What ?
Seriously, I don't know why you ask this. If you want to write an antivirus, forget it, you don't appear to come close to knowing enough to do that.
If you want to write a virus, thankfully, that is plainly beyond you, also.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
I want to Know about antivirus functionality ?
Can u discribe or not?
If you can think then I Can.
|
|
|
|
|
And what would this have to do with VB. I know you have the wrong forum I think you may even have the wrong site.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Is MFC VC++ is suitable for it? I am not trying to write code for Antivirus or Virus. My purpose is finding Logic for behind of ANTIVIRUS Functionality.
If you can think then I Can.
|
|
|
|
|
eg_Anubhava wrote: My purpose is finding Logic for behind of ANTIVIRUS Functionality
Then read some of the white papers available from the various vendors, that what they are for clickety[^]
Your question about the relevance of a language to the logic does not make sense.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
eg_Anubhava wrote: am not trying to write code for Antivirus or Virus
Then you're in the wrong place.
eg_Anubhava wrote: My purpose is finding Logic for behind of ANTIVIRUS Functionality.
If you're not writing an antivirus, I can only assume you're writing a virus.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
I thin u have not answare of my question?
You are only wasting of my time.
If you can think then I Can.
|
|
|
|
|
...no you are wasting there time...
Regards: Didi
|
|
|
|
|
What is it? My question is Logically strong. So how can u say it.
If you can think then I Can.
|
|
|
|
|
You don't say, what you need your info for, so it looks like you are hiding something. Plus: if you realy work for the company, that the link on your resume is pointing at, you can ask your coleagues. By the way, you question is not a vb related question.
Regards: Didi
|
|
|
|
|
Yes u r right.It's not my official metter.
It's a question for finding Logics. Nothing to do anything.
OK
If you can think then I Can.
|
|
|
|