|
|
#include <algorithm>
#include <vector>
#include <functional>
#include <list>
using namespace std;
typedef list<int> LIST_INT;
bool IsOdd (int i) {
return ((i%2)==1);
}
int AbsToRelPosition(LIST_INT list1, int value)
{
LIST_INT::iterator pos;
pos = find_if(list1.begin(), list1.end(),bind2nd(greater<int>(), 1));
return 0;
}
int main () {
LIST_INT m_shown_cols; //shown column list
LIST_INT m_hid_cols; //hidden column list
LIST_INT m_shown_rows; //shown rows list
LIST_INT m_hid_rows; //hidden rows list
for (int i = 0; i < 2; i++)
{
m_shown_rows.push_back(i);
}
for (int j = 0; j < 4; j++)
{
m_shown_cols.push_back(j);
}
int place = AbsToRelPosition(m_shown_cols, 1);
LIST_INT::iterator pos;
pos = find_if(m_shown_cols.begin(), m_shown_cols.end(), bind2nd( greater<int>(), 1));
}
in this piece of code i am getting UMR(using purifier) in find_if using in AbsToRelPosition function but if i am using same piece of code in main function as shown above in my code purifier is not showing UMR.Pls help me wht would be the reason.
thanking you
Deepesh
deepesh
|
|
|
|
|
how to selective loading BHO in Chtmlview environment
wqewqqeweqwrwerewrwe
modified on Tuesday, May 27, 2008 11:40 PM
|
|
|
|
|
"BHOs are not loaded by other applications that host the WebBrowser control or by windows such as HTML dialog boxes." from [Building Browser Helper Objects with Visual Studio 2005^].
BTW, why need a BHO, when you have full control over the events and contents of html document when using Chtmlview( or Webbrowser control hosted in your application), BHO are used to extend custom functionally to Internet Explorer where you don't have direct control (like hosting in your app).
|
|
|
|
|
ok thank you...
wqewqqeweqwrwerewrwe
|
|
|
|
|
hi
i have an MFC dialog based application .
when the user enter his information and click save ...save dialog appears and the process goes as normal .
my question is ..when the user modifies his info and click the save button again ..i dont want the save dialog to appear just save the modified info.
how can i do that while iam using the following function to save:
void CmyDlg::Onsave()
{
this->UpdateData();
CFile f;
char strFilter[] = { "CCC Files (*.ccc)|*.ccc|All Files (*.*)|*.*||" };
CFileDialog FileDlg(FALSE, ".ccc", NULL, 0, strFilter);
if( FileDlg.DoModal() == IDOK )
{
f.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite);
CArchive ar(&f, CArchive::store);
ar << m_EDIT1<<m_EDIT2;
ar.Close();
}
else
return;
}
f.Close();
}
pleease..i need help in this
i tried different things but nothing works
|
|
|
|
|
lahom wrote: my question is ..when the user modifies his info and click the save button again ..i dont want the save dialog to appear just save the modified info.
how can i do that while iam using the following function to save:
Store the necessary information in CmyDlg .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thank u for ur fast reply.....
DavidCrow wrote: Store the necessary information in CmyDlg.
but what does this supposed to mean
did i make myself clear here or???
|
|
|
|
|
lahom wrote: but what does this supposed to mean
Take the information returned from FileDlg.GetFileName() and store it in the CmyDlg class.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
ok...
then what???
could u explain more ur idea??
thank u
|
|
|
|
|
Create member variable of string type in ur CMyDlg class. Initialize it to Empty string. Lets name it as m_strFileName. Store the FileDlg.GetFilename() in that variable when you click save.
and in Save Add condition for checking the file name is not empty.
CMyDlg::Save()
{
if(m_strFileName.IsEmpty())
{
CFileDialog FileDlg(TRUE,...);
FileDlg.DoModal()
m_strFileName = FileDlg.GetFileName();
}
... //Your Code for saving the file with name m_strFileName.
}
|
|
|
|
|
thank u very much ....it works just fine
thaaaanks...i appriciated
thank u all ![Rose | [Rose]](https://www.codeproject.com/script/Forums/Images/rose.gif)
|
|
|
|
|
Which one of WaitForSingleobject() and SetTimer() is better when I need to check for something in a regular interval.
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
They each do different things. Perhaps if you explained what the "something" is that you are checking, we could be of more help.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I want one of my function to be called every 100 ms which will do some procees.
This function will check some conditions to call or not some other small functions.
To call the function every 100 ms, which is better timer or WaitForSingleObject()?
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
How do you intend to use WaitForsingleObject..???
You can definitely use SetTimer().
|
|
|
|
|
It seems we can use both, but I want to know which one is better when considering performance of application something like CPU usage etc.
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
WaitForSingleObject Infos[^]
I think this is going to be too much for what you need. SetTimer is much easier and is good enough for your requirements.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Thanks for great help from everybody!!
As there are two main tasks, MIDI communication and GUI simulation of sent/received MIDI, performance is important.
I will try both and select which is better.
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
I am taking an independent study course (ISP) and so far i have no clue what i am doing. i have managed to scrounge up some pathetic codes that havent worked sofar, and i was told that if my last 2 do not work, i fail, and i have an exam, and its all due friday. I Have read the the book at least 6 times, and still i have no idea how to make a program. So i am going to ask for serious help.
i have to write a program that will determine an employee's net pay based on the following info.
employee is being paid 10.50 dollars an hour for the first 40 hours
he recieves time and a half for the first 5 hours over 40 hours
he recieves double pay for hours over 45 hours
he is taxed at a rate of 31%
he pays 1.9% canada pension plan
.4% union dues is also payed.
apparently the program read as input the number of hours the employee has worked. the output screen should display gross pay, amount going into taxes, and the net income for the week
example output supplied:
hours worked 42.00
Regular pay 240.00
Overtime pay 31.50
---------------------
Total Gross Pay 451.50
deductions
taxes 139.96
cpp 10.84
ei 8.58
Union dues 1.81
---------------------
Net Pay 290.31
Yes it is directly from the book. I am trying to be super specific. I dont want anyone to like, write out the code for me, because its against the rules im pretty sure, and i learn nothing from it. I just would appreciate a guide on how to actually figure this out, so i can do the exam, and lesson 2 from this module. And I know, it sounds very demanding. but this is like, i fail i owe the school 200 dollars for the ISP.
:I
|
|
|
|
|
Pathetic wrote: Regular pay 240.00
I think this should be $420.00
Pathetic wrote: apparently the program read as input the number of hours the employee has worked.
void main( void )
{
double dHours;
std::cout << "Hours worked: ";
std::cin >> dHours;
} Only after you get past this hurdle should you continue.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanks! I am pretty sure this will help alot
:I
|
|
|
|
|
Hi Pathetic
Enter an Hour as an input
and you use if -else condition for hours and according to hours you caclulate the Total gross pay.
now it is easy for you to calculate the deduction using simple formulas
if hours is =< 40
than hours*dollar
else if hours is >40 and less <= 45
1) 40*dollar
2) (modify)(hours - 40)*(10.50+(10.50/2))(/modify)
else if(hours >45)
1) 40*dollar
2) 5*10.50*(10.50/2)
3) (hours-45)*2*10.50
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
|
Most Welcome
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|