|
Hi Maxwell, thanks. I should have mentioned the calculation is indexed by the loop. I've been thinking of something like:
#define MAX(x,y) ((x)>(y)) ? (x) : (y)
but then I have to calculate x on each iteration so that isn't an improvement.
|
|
|
|
|
if quantity is not i , j dependent then Maxwell suggestion still applies.
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
|
|
|
|
|
Yes, of course! We shouldn't mislead anyone. Good of you to point that out.
|
|
|
|
|
well... assuming that is not a poor example... if quantity is not based on i,j why is it inside a loop? Since value is assigned not summed or similar, only the last value of the loop is stored. You could count backwards and stoop on the first hit and get the same result.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I am using activex in VC application. It has some connect method which takes User Name and passwords.
When I give user name and password of remote machine or network machine. Connect fucntion gives error : "Invalid Network Credentials".
Does anyone came across this or know what I have to set to by pass this network credentials problem.
Thanks in advance
AmolM
|
|
|
|
|
I want to display a value from the file and display it on the editbox. for example
in the file the time format is something like this
11:06:16:254
now i need to put 11 in one editbox, 06 in the next editbox and so on... that means i will have 4 edit boxes to display the time.
the file format that i have is of .dat extension. i am using mfc for this
please give me some leads.
|
|
|
|
|
You have a problem reading from the file or displaying it on the screen?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
i am able to read the data from a file but i am can display only the last value of the file. i want to display all the values in that file. i have created a timer for that which fires every one sec. what needs to be done to show all the values in the editbox.
|
|
|
|
|
Chandrasekharanp wrote: please give me some leads.
1) research the MFC library documentation for File I/O. This will provide you with the ability to open the file and read data from it.
2) research the MFC documentation for the class CString. This will provide you with solutions for separating the different parts of the time data.
3) Research the MFC CEdit control. This will lead you solutions for displaying the edit controls and setting the data into them.
4) Thank your instructor for giving you such a simple assignment.
led mike
|
|
|
|
|
Priceless[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Wow
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yeah hahaha, he's got a tight grip on that whole critical thinking thing eh?
led mike
|
|
|
|
|
Logic? We don't need no steenking logic!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey what happened to CPhog?
Never mind - I restarted FF and all is well
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Hey what happened to CPhog?
I'm using it to post this?
Damn! Missed the opportunity to say "It works on my machine!"
Last modified: 12mins after originally posted --
led mike
|
|
|
|
|
hehe see my modified post
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You need to CFile class and CString then you can use of SetWindowText for show values on the editbox.
|
|
|
|
|
Hamid. wrote: you can use of SetWindowText for show values on the editbox
Don't you like the idea of having a member variable? Do you really need SetWindowText to set text of an edit box in MFC?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yeah I agree with you.
|
|
|
|
|
Rajesh R Subramanian wrote: Don't you like the idea of having a member variable?
Sure, as long as it's a CEdit variable.
Rajesh R Subramanian wrote: Do you really need SetWindowText to set text of an edit box in MFC?
No, but the other alternative can, and often does, cause problems that are easily avoidable.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Sure, as long as it's a CEdit variable.
I meant that, of course.
DavidCrow wrote: No, but the other alternative can, and often does, cause problems that are easily avoidable.
But there are circumstances when it comes very handy. And as I kept doing it, I learned my way to do it correctly. I'd agree that it may create problems though.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hello everyone,
In the Bjarne's book, there is a line of code like this,
typedef typename A::template rebind <Link>::other Link_alloc;
It means if A is allocator, we can use use to allocate arbitrary type of object instance, said by Bjarne.
I understand this statement, my question is about the grammar. Do we need the template keyword? Why?
I have tested without temlpate keyword, the code still works. Any ideas?
template <class T1> class Foo {
public:
template <class T2> class Goo {
public:
typedef T2 GooValueType;
};
};
int main()
{
Foo <int>::Goo<char>::GooValueType a1;
Foo <int>::template Goo<char>::GooValueType a2;
return 0;
}
thanks in advance,
George
|
|
|
|
|
George_George wrote: In the Bjarne's book, there is a line of code like this,
typedef typename A::template rebind ::other Link_alloc;
Whats the context? or the page number?
|
|
|
|
|
Section 19.4.1 The Standard Allocator. Any ideas?
regards,
George
|
|
|
|