|
AnayKulkarni wrote: I am trying to do it but not getting success.
Perhaps you could explain what you mean by this. How are you sending the data, and what happens at each end of the communications channel when you do?
MVP 2010 - are they mad?
|
|
|
|
|
Usually, the best way to do that is to have your object support some kind of serialization: you can add a function to load a function to save your object into a "file" (here, through the handle of the serial port, but this is the same). These methods read and write all data members of your object that needs to be sent to the other side.
|
|
|
|
|
You should serialize (see Serialization) your objects, send serialized data over the serial line and then deserialize them on the other side (in order to re-create the original objects).
MFC supports serialization for CObject -derived classes. Another option maybe Boost Serialization , you may even write your own serialization mechanism (the task is simple just for basic data structures, though).
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]
|
|
|
|
|
Hello to all,
I am using Windows CE6.0 for my project. In my project I am using tab control on a dialog box. For a tab control I have to use INITCOMMONCONTROLSEX structure and InitCommonControlsEx() function. I know that to use this function I have to include "commctrl.h" header file and "comctl32.lib" library file. So I included "commctrl.h" header file and "comctl32.lib" library file in my project but still I am getting error that "unresolved external symbol_imp_ InitCommonControlsEx()". Is there any more settings that I am missing? And more surprising is that, same project works perfectly on Windows 2000 but gives error on Windows CE6.0. I am using Visual Studio 2005.
Can anybody tell me what to do? Is there any different settings? It is really very very urgent so plz help me out.
Thanks and Regards,
Anay
|
|
|
|
|
Comparing the documentation for DesktopWindows[^] and WinCE[^] shows that the former uses comctl32.lib whereas the latter uses commctrl.lib. You need to link with a different import lib.
Judy
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
Hey all,
I want to implement a program in an embedded system. I want to write a program which simulates a human heart for the purposes of detecting a heart attack. The model of the heart should be running, then a second program will analyze this information output from the model, and when conditions are met, indicate that a heart attack is occurring.
How should I approach the modeling of the heart. Maybe EKG waves is a good indicator of a heart attack, however, what the best way to model EKG activity in an embedded system?
Thank you.
|
|
|
|
|
I smell a homework problem here although an interesting one. If you're using an embedded system to actually detect a heart attack, what do you think you'd use as input? What has your literature search turned up about EKG and heart attack?
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
So far the research I have done and books on EKG I am currently reading indicates that impending myocardial infarction (a heart attack) is related to a rise in the ST wave segment of the EKG (ST elevation). SO it seems simple enough to model only the ST segment of the EKG. Maybe using a random number generator? Suggestions are welcome.
|
|
|
|
|
user_void wrote: A Hart Attac is related to a rise in the ST wave segment of the EKG (ST elevation). SO it seems simple enough to model only the ST segment of the EKG.
Hi
You are asking a question on a CPP/MFC forum. Not all of us have a degree in medicine. What does the above mean in plain English.
I assume that your data arrives in a continuous bite stream, which is being buffered somewhere, and that your code will read the buffer, and do it's thing.
My gut feeling is that your first step should be to do some form of Fourier analysis on the Data. Details on how to do that can be found by googeling Digital Data Processing. A word of warning: this is NOT a trivial subject!
Regards,
Bram van Kampen
|
|
|
|
|
It would seem that a random data stream would not be a sufficient model of anything other than a random stream of data. An instrument looking for a heart attack has to know both what is normal and what is abnormal. If it's normal, don't mess with it and if it isn't, sound an alarm or give the heart a nice jolt and get it started again. Of course, with this problem statement, not evertthing abnormal is a heart attack. And I know from experience that not all heart attacks involve the searing pain down your left arm.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Okay, lets assume we are modeling the ST-segment elevations. The program knows what values are abnormal and will only sound an alarm when an abnormal condition is detected. If the range of this number is from 0-10, and anything greater than 4 is a sign of myocardial infraction. And if a rnd number generator is not the best solution for modeling the ST-segment elevation, then what would be the best solution?
|
|
|
|
|
To step back, is a heart attack the only reason the number climbs above a 4? I would expect EKGs are graphs for a reason and it's a waveform that suggests the heart attack. But I'm not an expert on EKGs, I've seen a number so I know what they look like and what they're used for but I haven't studied their signal signatures in detail. I just suspect that it's more than a simple threshold problem.
If the instrument is a simple monitor, a occasional false positive isn't a huge problem if they're reasonably infrequent. However, if this is part of a defribrillator that's meant to be used by medically untrained personnel or to be implanted and operate automatically, shocking a normally beating heart probably isn't the greatest idea in the world.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Yes, usually when a specific segment of the EKG (ST-segment) rises above a threshold number, it indicates impending myocardial infraction. Perhaps I had structured the question incorrectly to begin with. Since I am doing all software, I an not designing an EKG machine, nor am I using an existing EKG machine for an input interface. What I want to model is the output of an EKG machine. Not even the entire output waveform of an EKG, but a specific segment (as mentioned above). I'm just trying to make the modeling as simple as possible. Thus far, I can only think of random number generator.
|
|
|
|
|
If all it takes is looking at a stream of data in the range of 0-10 and noticing when a value rises above 4, the problem is trivial. A random number generator would work just fine. Or if you wanted to get a little fancier, try to model the waveform and throw in some random "noise" which occasionally rises to the level of a heart attack.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
hello everybody
when i include a header file with space between words of its name then my compiler cannot link them and take error:
[sajad@sajad binary search trees]$ g++ binary\ trees.cpp
binary trees.cpp:3:73: error: /home/sajad/src/ds/test/binary\ search\ trees/BST_node_base.h: No such file or directory
binary trees.cpp:4:63: error: /home/sajad/src/ds/test/binary\ search\ trees/BST.h: No such file or direct
while the directory and address is completely true.
#include<iostream>
#include "/home/sajad/src/ds/test/binary\ search\ trees/BST_node_base.h"
#include "/home/sajad/src/ds/test/binary\ search\ trees/BST.h"
but when i change the name ,without space between it then it run correct,what can i do to solve this error?
also when i include a fileheader and in it use for example cout<<"hello"<<endl; takes="" error,but="" when="" i="" include<iostream=""> using namespace std it work true.does it must be as i write or there is another way to solve this?
this is the part of header file:
#include<iostream>
using namespace std;
template <class T>class BS_Tree{
public:
bool direction;
int n;
BST_node<T>* root;
BS_Tree(){
root=NULL;
}
....
|
|
|
|
|
khomeyni wrote: what can i do to solve this error?
what error ?
why would you put spaces between the parts of the path ?
|
|
|
|
|
You may either avoid spaces inside the paths or use relative ones.
As about the namespace,
You have two options:
- specify, as you did,
using namespace std; - Qualify each (
std ) object with the std namespace , e.g. std::cout instead of cout , std::endl instead of endl etc...
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]
|
|
|
|
|
Take out the back-slashes that quote the spaces. That is, change this:
#include "/home/sajad/src/ds/test/binary\ search\ trees/BST_node_base.h"
#include "/home/sajad/src/ds/test/binary\ search\ trees/BST.h"
to this
#include "/home/sajad/src/ds/test/binary search trees/BST_node_base.h"
#include "/home/sajad/src/ds/test/binary search trees/BST.h"
Oh - but don't, don't, don't use absolute paths in code like that! What happens when the code-base moves? You're screwed, aren't you.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Stuart Dootson wrote: Oh - but don't, don't, don't use absolute paths in code like that! What happens when the code-base moves? You're screwed, aren't you
ok i will do it,i have changed it to :
Stuart Dootson wrote: #include "/home/sajad/src/ds/test/binary search trees/BST_node_base.h"
#include "/home/sajad/src/ds/test/binary search trees/BST.h
and solve my problem.
thnx for all answers.
|
|
|
|
|
Hi all,
i want to generate service from my application exe.
i want to generate such type of service that is never stop or in other words if any body stop this its start automatically.
please provide me help or guidance for this.
if possible please provide me any example.
thanks in regards.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
|
i m creating service like this
SC_HANDLE hdlSCM = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
TCHAR lpFileName[MAX_PATH+1];
GetModuleFileName(NULL, lpFileName, MAX_PATH);
Calling = lpFileName;
if (hdlSCM == NULL) return ::GetLastError();
SC_HANDLE hdlServ = CreateService(
hdlSCM,
ServiceName,
ServiceDisplayName,
STANDARD_RIGHTS_REQUIRED,
SERVICE_WIN32_OWN_PROCESS,
SERVICE_AUTO_START,
SERVICE_ERROR_NORMAL,
Calling,
NULL,
NULL,
NULL,
NULL,
NULL);
DWORD Ret = 0;
if (hdlServ == NULL) Ret = ::GetLastError();
CloseServiceHandle(hdlServ);
its create service succssfully.
but when i want to start service its not able to start service
its return this error code
ERROR_SERVICE_REQUEST_TIMEOUT
please help me for this.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Le@rner wrote: its return this error code
ERROR_SERVICE_REQUEST_TIMEOUT
Inside the service itself, did you set the flag indicating it has completed its startup i.e. set the status to SERVICE_RUNNING in a call to SetServiceStatus? If you don't, you will get this error when you try to start the service.
Service Info[^] contains lots of service info, including samples.
Judy
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
|
Hello, in my aplication using VC** 6.0 , there are two buttons ( + and -) they controls the value of 16 different edit boxes. It's working, but now i want that if you press and hold one these two buttons the value on their respective edit box increases until you release the button. From the help, i read that you can do this using GetState(), with this mask 0x0004, but i can't get it works. here is some code
void CCalibracionDlg::OnBUTTONmas()
{
unsigned int BotonHold=0;
char incremento;
BotonHold=0x0004 & m_Button_mas.GetState();
while (BotonHold != 0)
{
incremento=1;
Decremento_Incremento(incremento);
BotonHold=0x0004 & m_Button_mas.GetState();
}
}
this is the code for button "+" . I hope i've explained it well.
|
|
|
|