|
Thanks,
I just pasted that from my project overview.By any chance would you be able to help me as I am desperate at this stage.I dont know where to start in regards to the code or what code to use??
klck2000
|
|
|
|
|
klck2000 wrote: Could you give me...an idea on how to do this even...
Here is one idea:
class DataSet
{
public:
DataSet() { }
void Add( const double dHeight )
{
m_vecHeights.push_back(dHeight);
}
double Mean( void ) const { }
double Median( void ) const { }
double StdDev( void ) const { }
private:
vector<double> m_vecHeights;
};
void main( void )
{
DataSet ds;
}
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thanks very much,i tried something like that lastnight though id to use floating point values so used
class DataSet
{
private:
float Vector[200]; //Holds the floating values
int Number_of_Elements; //Holds the number of elemets -1
void Sort_Vector(); //Sorts the vector to calculate the median value
public:
DataSet(); //Constructor of the class
~DataSet(); //Destructor of the class
void Add_Element(float float_value); //Add an element into the vector
float Calculate_Mean();
float Calculate_Median();
float Calculate_Standard_Deviation();
};
how do you think that looks??
thanks,
karl
klck2000
|
|
|
|
|
klck2000 wrote: float Vector[200]; //Holds the floating values
One of your requirements was to use the push_back() method to add items to the vector. What you have does not satisfy that requirement.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i cannot use the push_back method,i was having problems with understanding it.Any simple code suggestions??
klck2000
|
|
|
|
|
klck2000 wrote: Any simple code suggestions??
See here.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
How's it going with this project?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
We have 3 variables defined at file scope. The project is for a DLL that's loaded by other modules. The globals are objects that are dynamically allocated within a C++ class method using 'new'. Within the objects, more tables (arrays) are dynamically allocated using 'new'.
We're experiencing 'memory access' crashes when somehow the globals are corrupted. Its weird because the app will work fine for awhile, then get a crash. It can happen at startup, in the middle of using the app, or right before closin the app. These variables must be global and cannot be member variables of the main class. (Long story)
If the DLL is not loaded, no crash occurs. So we're confident its the DLL.
My question, is there a way to ensure that the global pointers remain intact? Or ideas on monitoring the pointers? I thought about using static in the global definition, but wasnt sure about the effect. I also thought about making the globals variables of the main looping function, but figured since I'm calling new, I wouldnt be protected by function scope memory management.
There's something at the DLL level that's screwing us up. We're desperate for a solution to ensure global pointers are not corrupt. Ideas??
TIA,
C
|
|
|
|
|
Did you try to use your debugger ?
I know, these kind of bugs are probably hard to reproduce but if they happen quite rapidly, then using your debugger will give a lot of information.
|
|
|
|
|
When a user selects the "Preferences" menu item in my application, it triggers the method CMainFrame::OnEditPreferences() in MainFrm.cpp. At that point I create a dialog and receive input from the user. Now, I need to pass that information on the document (*Doc.cpp).
I have tried GetActiveDocument() but it does not seem to contain my custom data members; do I need to cast it to another type? And if so, what headers do I need to include? Thanks for any help.
EDIT: I solved the problem by moving the OnEditPreferences() method to the document file with the Class Wizard. Sorry for any inconvenience.
|
|
|
|
|
titaniumdecoy wrote: I have tried GetActiveDocument()
This function returns ur active documents pointer as CDocument*. So u have to cast it to CYourDocument*.
titaniumdecoy wrote: it does not seem to contain my custom data members
Then u can see it containing ur custom data members.
KIRAN PINJARLA
|
|
|
|
|
I'm trying to create a program that will send information to several different forms on a webpage with one http request (i.e. posting to a message board with a subject line, message data, signature line etc...) I'm using wininet to do this, however I can't seem to get the right combinations of headers. I know i am going to use POST, but do I need to include a content-type header? and if so which one? Also, how do I need to actually format the data I am sending? Any help would be greatly appriciated.
|
|
|
|
|
Yes to both your questions. You need to research the HTTP protocol.
epicyeti wrote: but do I need to include a content-type header? and if so which one?
Like ApplicationXXX-UrlEncoded or some such odd thing. You also need content-length header if the wininet library does not create that for you... I can't recal if it does.
epicyeti wrote: Also, how do I need to actually format the data I am sending?
Each variable is a name=value pair with the "value" UrlEncoded. Multiple variables are seperated by amperstand character.
hello=world&post=done
led mike
|
|
|
|
|
I have Visual C++ .NET 2003, and wanted to learn how to create basic applications (and games) for the windows mobile 2003 PocketPC operating system. (I actually wanted to learn for Windows Mobile 5.0, but don't have Visual Studio 2005).
Does anyone know where I can find any tutorials for this? I have very basic C++ programming knowledge.
Thanks in advance!!
-- modified at 14:47 Tuesday 8th August, 2006
|
|
|
|
|
Well, I suppose I found the answer to my own question! If anyone else is wondering, the proper documentation is right here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/guide_ppc/html/Dev_Guide_for_Windows_Mobile-Based_PocketPCs.asp
|
|
|
|
|
|
I have some tester and every time after it test,It will output the result in text file and keep it in the directory for example C:\Data.
I want to get the data of these file in real time for process some job.
My question is how I detect that now the file already happen and how to get the file name(if the file name is the barcode of each board).
|
|
|
|
|
Are you wanting to monitor a folder for changes to a file? If so, check out ReadDirectoryChangesW() and/or FindFirstChangeNotification() .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Can you give some example
Thankyou
|
|
|
|
|
search "fwatch sample" in MSDN from VS 6.0 (Not sure if it's in the following MSDN product lines)
|
|
|
|
|
|
MSDN code[^]
Just change the notification flags in the above example to reflect your heart's desire.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Seehere[^]if its good for you
|
|
|
|
|
Hi people
I'm working with a windows hook, and I intercept WM_CREATE for all the windows.
I need to know if a window is going to be visible, I tried using IsWindowVisible(HWND) and checking WS_VISIBLE flag (wich are the same :S) and I always get false, because the window is not yet created.
Do someone knows how can I do to know if the window beign created is going to be visible?
Thanks in advance
|
|
|
|