|
Its a question or its a notification?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
You are in a completely dark room, facing north west.
Courtesy of John Simmons
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Let's hope The Big Green Snake not only Bars The Way, but decides to have him for lunch.
|
|
|
|
|
Done. Now I'm going to enjoy a week of holydays...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I recently download the program/class CSMTPConnection which can be found at: http://www.codeproject.com/KB/IP/csmtpconn.aspx#CSMTPAddress. After making some minor changes to the code for my system, I find that I cannot use to send email. The problem is that my mail server requires authentication which I interpret to mean a password. This program/class does not allow me to supply a password. I am doing this as a learning exercise. Is there a different class I should be using to send email? If I use the yahoo email server, will that work?
I am doing that, at least for now, as a learning exercise.
Thanks
Bob
|
|
|
|
|
|
I have a neat way of registering software. The software creates
a ID number based on the time of installation, I provide a passcode
that is stored in the registry to activate the software.
It works, its simple. Only problem is, its dependent on the phone.
Too much time is spent on the phone with the person activating the
software.
Im trying to come up with an easy way where:
1. I generate a list of say 100 valid passcodes.
2. When the software is given a passcode, it downloads the list of
valid passcodes from the server and checks to see if this is a valid
passcode.
3. If it is, it removes it from the list and uploads the new list
of 99 passcodes to the server. That way they can just register once.
4. When the original list of valid passcodes gets low, I'll generate
more and restock the list.
I can do almost everything except upload that new list, which is just
a .txt file, to replace the current existing list.
I looked all over codeprojec and am looking for an easy sample
project that shows how to activate software or an easy project that
shows how to upload a file to a server to replace a current existing
file. Any chance any one knows of any sample project or can email
me anything?
Please, please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina
|
|
|
|
|
How are you downloading the file?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
There is a simple project called CWebGrab on the codeproject
site. I lets me grab a file from the server. Easy to use.
|
|
|
|
|
DanYELL wrote: There is a simple project called CWebGrab on the codeproject
site.
Which uses CHttpFile::Read() . That class has a Write() method that you should be able to use.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I would suggest to not download "stuff" on the users's computer.
Instead of the phone, use email.
- User gets "code" from software
- User sends "code" to company.
- Company validates "code" and generate "activation code"
- Company sends back "activation code".
- User paste "activation code" in software
- Software validate "activation code".
This signature was proudly tested on animals.
|
|
|
|
|
I agree. But here is what happens.
- User gets "code" from software.
- User sends "code" to me.
- User gets impatient and calls.
I cant begin to tell you how many people call to say
"I just sent you an email, can you give me a time-frame
as to when you will reply". And I just got the email.
|
|
|
|
|
This should be automatic.
In my experience, the usual response time is up to 5 "work" days.
This signature was proudly tested on animals.
|
|
|
|
|
i have taken one radio button i want to change text of it. can anybody tell how can i change the text of it. in my programme
thnz
|
|
|
|
|
_T("No name") wrote: i have taken one radio button i want to change text of it. can anybody tell how can i change the text of it.
They hide that information in the documentation[^]
|
|
|
|
|
led mike wrote: They hide that information in the documentation[^]
Bastards!
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
For most controls you can use of SetWindowText or WM_SETTEXT.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
My project is about data acquisition from 4 sensors through USB port and show the data on PC monitor in graph.The read data from each sensors is so fast(less than millisecond) So,I separate 4 thread for draw graph in each sensor.
Because all thread use same device context, before each thread drawing it still waiting for each other.
Please advise me some solution for make 4 thread and each thread has the private DC.
I mean when the data occur the thread can draw without waiting for other thread.
|
|
|
|
|
I think you'll find you can only use a DC on the same thread on which the window was created. In general, the best method is to share the data with a UI thread, which will then draw it.
Max++ wrote: The read data from each sensors is so fast(less than millisecond) So,I separate 4 thread for draw graph in each sensor.
Can you define what you mean by 'fast (less than millisecond)'? If you mean 'updates every millisecond, then you're not going to have too much luck just collecting it in threads in Windows - Windows isn't designed for those sorts of response times - unlike an RTOS.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Google for "mtgdi sample".
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
As Stuart said you should only use a DC from the same thread as the window was created.
But I consider that a minor problem as I believe that you don't need multiple threads for drawing the graphs. Read on...
I've written quite a few (>25) applications with similar functionality, so perhaps I can contribute with some thoughts.
You have to distinguish between the different layers in your application.
You have at least three layers here that should not be mixed up: the hardware layer, the data acquisition layer and the presentation layer.
Max++ wrote: The read data from each sensors is so fast(less than millisecond) So,I separate 4 thread for draw graph in each sensor.
Here's the mix up.
Even though your sensors can barf up measured data at that rate, it doesn't necessarily mean that the data should be presented to the user at the same rate, or in other words "in real-time". There's no point since the human eye cannot cope with that speed.
You need to think about the requirements of your application; shall it e.g. be possible to save the sampled data and what is the sample frequency, or is it just for presentation?
Perhaps the data acquisition layer should save every sample, but the presentation layer only need to ask for the current value of each sensor at e.g. 2Hz rate.
You have to tell us more about the requirements of your application for us to be able to suggest a suitable design.
But, based on my experience of common demands for such an application, I would suggest to have the following in mind:
- The main (UI) thread is responsible for drawing all the graphs that are supposed to be presented to the user and would update the graphs on timer based events with rather low frequency, e.g. 2Hz to 5Hz. This would be the presentation layer.
- The hardware layer continuously issues read requests in a "reading worker thread" with calls to
::ReadFile() that will return one or more data samples. They should probably be put in a queue from which the data acquisition layer can read them. In order to prevent immense memory allocation and deallocation I suggest using reference counting smart pointers as elements of the container. - If the gathered data needs some kind of interpretation, each sensor could have a thread that collects the data and save it in e.g. list in order to be able to save it later. When this thread runs it moves the data from the queue shared with the hardware layer into the its own container and updates the "current value" shared with the presentation layer. This would be the data acquisition layer.
If the raw data can be used for presentation you can omit the data acquisition layer and simply read the top element of the queue, or list, for each sensor that the "reading worker thread" puts the data in.
This way you have a clean design, you don't do any unnecessary updates to the GUI and you're able to save every data sample gathered from each of your sensors.
Sometimes the samples should be tagged with the time that it was sampled, but that depends on the requirements.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks a lot Roger.
Your answer and solution very useful for me and also difficult for me to finish it.
Actually, my sensor is A/D concept that some time need to measure AC voltage
and show the data in real time, look like oscilloscope.
if you have some link, book or example for this concept.
Please advise me.
Thanks
|
|
|
|
|
Max++ wrote: measure AC voltage
and show the data in real time, look like oscilloscope.
I'm suspicious about this requirement.
If you have an oscilloscope, connect it to an AC signal and let it run freely as in "real-time", all you'll see is a blur. To have it make sense you'd have to use the trigger functionality.
You have to describe what the purpose is, as in "what will the user do with the graphs presented in front of him". My point is that you probably won't need to present every sample to the user as soon as it arrives.
If this is for e.g. signal calibration it would probably do quite well if the graphs were updated twice per second. Perhaps every sample should presented in that case, but you can disregard from the "real-time" problem.
Max++ wrote: if you have some link, book or example for this concept.
Regarding how to call ::ReadFile() and how get the data, you may find this article[^] to be useful. It's about serial port programming, but the concept of reading is the same.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
if the data update every 1 millisecond.I get data and move it to some variable, after finish 1000 data I draw graph one time.That mean draw every 1 second.
Can you tell me, Is this oscilloscope concept?
|
|
|
|