|
I think you forgot this line m_pImageList->Add(Bmp,RGB(100,105,0));
CBitmap *Bmp;
m_pImageList->Add(Bmp,RGB(100,105,0));
m_List1.SetImageList(m_pImageList, LVSIL_NORMAL);
|
|
|
|
|
Sir,
int a = 1;
for(int i = 0; i <=10 ; i++)
a = a + a++;
There is no problem in understanding the above written loop
I have some problem in the following code.Please explain it.
for(int i = 0 ; i <= 10 ; i++)
a = a + ++a;
Please explain the working .I mean how it works.
Thanks
|
|
|
|
|
lets take it step by step, let a=1 initially:
1. i=0
2. a=a+ ++a;
Because the ++ is a prefix, the increment is done before evaluating the expression
here: a = 1 + ++a
=1 + (a=a+1);
=1+ (a=1+1);
=1+ (1+1);
=3
etc.
hope this helps.
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Mohammad A Gdeisat wrote: lets take it step by step, let a=1 initially:
1. i=0
2. a=a+ ++a;
Because the ++ is a prefix, the increment is done before evaluating the expression
here: a = 1 + ++a
=1 + (a=a+1);
=1+ (a=1+1);
=1+ (1+1);
=3
That is not correct, since the prefix operator
changes the value of a before the expression being evaluated,
hence (with a=1 initially) you will have
a = 2 + 2;
=4
at first iteration. I tested it.
|
|
|
|
|
|
postfix incrementation (i++) :
increments the variable, but returns the value of the variable, before the incrementation.
prefix incrementation (++i) :
increments the variable and returns the new value.
void f() {
int i = 0;
int j = i++;
ASSERT(j == 0);
}
void g() {
int i = 0;
int j = ++i;
ASSERT(j == 1);
}
|
|
|
|
|
After function receive() is called, FD_READ will be fired again, thing will start over, it never reach the next line (a=a+1 and b=b+1)
Is there any way to pause winsock from sending message for a while until I finish my job?
LRESULT CClient::OnWinsock(WPARAM wParam, LPARAM lParam)
{
switch(lParam)
{
case FD_READ:
{
switch (streamToken)
{
case ST_HEADER:
recv(sc, (char*)&bi, sizeof(BITMAPINFO), 0);
a = a+1;
b = b+1;
streamToken = ST_BUFSIZE;
break;
case ST_BUFSIZE:
recv(sc, (char*)&bufSize, sizeof(int), 0);
streamToken = ST_BUFFER;
break;
case ST_BUFFER:
recv(sc, (char*)cscrbuf, bufSize, 0);
DrawScreen();
streamToken = ST_BUFSIZE;
break;
}
}
break;
return 0;
}
|
|
|
|
|
How is this OnWinsock() called?
It sounds like recv() is blocking...
|
|
|
|
|
Ok so I didn't think this day would come but I need to learn C++ for a project I'm thinking about pursuing. I have on my book shelf a book titled "C++ Primer Plus 3rd Edition" written by Stephen Prata and when I bought it several years ago was told it was "THE" book for anyone wanting to learn C++. I looked on Amazon and see the book is now up to a 5th edition and my questions are: Is this really "THE" book on C++, Do I need to update to the 5th edition and Has anyone else went from C# to C++ if so What was the learning curve like?
As always I trust the opinions of those here on CP so I came here first, please don't let me down by not answering
Richard
http://www.BellaDev.net
|
|
|
|
|
Hi,
It looks like if you're a profesionnal programmer (thus already having some experience),
this book ('C++ Primer Plus') isn't quite the one you need.
I think you should pick this book:
1. 'Accelerated C++ : Practical Programming by Example'
It belongs to the 'C++ In-Depth' Series edited by Bjarne Stroustrup himself
Of course the other books of the series are of very high quality too,
but these two might well be what you're looking for.
(Except maybe 'Essential C++', which isn't really recommended)
Plus, the book doesn't take the dumb 'let's make it C-wise, then C++-wise'
approach of way too many C++ books out there.
Alternately, there's another good book, and this one's free...
2. 'Thinking in C++' - http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
If you like to really understand C++ in long-term. The only 'issue' might be that
this book is rather a book for people migrating from C to C++, but don't fear it.
It doesn't cost too much to download it and see if it suits your needs
And you might like the fact that the authors of these books teach you things like
STL usage very early on.
Have fun learning C++, 'cause if you don't do what you like, you have to like
what you do
|
|
|
|
|
Hi
How can I get the list of domains in the network programatically so that
I can add them to the list box.
Thanks in advance
Taruni
|
|
|
|
|
does anyone know how to change bar color and make it smooth when using a manifest?
|
|
|
|
|
Assuming you mean when using XP themes (manifests have multiple uses), then no. The theme can override any styles/colors that it wants to, you don't have complete control over it like in the Windows Classic style.
|
|
|
|
|
For example, if we double click h files in windows explorer, all h files are opened by a single VC (app).
I want to do same for a kind of my files (e.g. extension is .myf).
currently, when I click a .myf file every time, the file is opened always by a new app of mine - if I click 5 of .myf files, I have 5 of my app opened - I think I need to do something special in register.
Any suggestions to solve the problem?
|
|
|
|
|
Whenever you exe starts you check if another instance is already running, if another instance is already running then simply send a message to the original exe with a filename.
Lots of articles here on instance checking.
My sins are bloody red, my coffee is a black hole.
|
|
|
|
|
HI
I'm interested of in "Multiagent Systems"
Who could send me some source code (in C/C++) concerning MAS problems
I can't find in internet.
|
|
|
|
|
Greetings:
I have this application here that builds absolutely error free when I specify that it be built using MFC from the DLL. But when I specify a build with MFC in a static library, suddenly, one of my classes won't compile. I get this message:
MeasurementList.cpp(66) : error C2039: 'classCEditList' : is not a member of 'CEditList'
c:\Development\uLTD\Software\uLTDTagTalk\EditList.h(50) : see declaration of 'CEditList'
MeasurementList.cpp(66) : error C2065: 'classCEditList' : undeclared identifier
CMeasurementList is derived from CEditList which is derived from CListCtrl. The main point I want to stress is that it builds and runs without any problems if I specify "Use MFC in a shared DLL".
Has anybody ever run into this? Any idea what might be going on here?
Thank you,
Mark
|
|
|
|
|
So have you looked at line 66 of MeasurementList.cpp , and line 50 of EditList.h ? Is classCEditList the name of a class?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi David:
Yes, I have. Can't find a thing wrong. What sort of things would I look for if the code builds without any problem if I specify use of the MFC DLL as apposed to using MFC in the static library? If it were something as obvious as a class name spelling error, that problem would show up regardless of the build type. There has to be something much more subtle going on here.
Mark
|
|
|
|
|
can any1 help me in drawing use case diagram and class diagram of UML using this case study plz?
The managing director of a large department store asks you to develop a database system for his business. He explains that the department store which is located in a ten-floor building in Manchester Arndale Centre has many different departments and each department is located on a floor of this building. The only way to get in touch with the employees of each department is by using the phone since each department has its own
phone line.
Each department employs a number of people and each employee has a manager who is also located within the same department. Each employee is represented using his employee number, name, and the department he works for. There might be many layers of management in some departments since these can employ a large number of people.
The department manager is the person who is charge of the management of the
department and he/she is reporting directly to the managing director.
For each department we would like to keep information about its name, floor and its phone number and of course, its employees and managers.
Items are located in departments so their sales should be recorded for each department. Each sale is given a unique identifier and we also keep the quantity and overall price of the sale. For each item the data kept are its name, type and color. We can assume that the name is unique for each item.
We would also like to keep information about the deliveries of items.
We would like to identify each delivery using a unique identifier and also know the quantity of a specific item included in a specific delivery. Since each delivery is related to a supplier, we need also to know the supplier name and the supplier number. The same item can be supplied by different suppliers and also the same item can be sold by different departments.
We do not keep any other data neither we are interested in adding other less useful information. For simplicity, we can also assume that a sale and a delivery always include only one item.
i wl b waiting for this
regards
wahid
|
|
|
|
|
gwahid wrote: i wl b waiting for this
ok.
have you at least tried to draw something ?
|
|
|
|
|
hi
thx for ur reply...actually i hv identified actors, usecases and their relation...but still im not so sure about if im doing it in right way.
as i have identified following actors
depertment, employee, department manager, managing director, sales management system and supply management
so im not sure for many things as
do i need to mention 1st para which s related to phone lines, n is it necessary to use this line....(department employees individuals) or maybe cz its obvious it will happen... i have lots of confusions regarding this.
Regards,
wahid
|
|
|
|
|
|
hi
thx for ur reply. actually i hv searched google alot and i hv read 2 books and i hv drawn a rough sketch. i jct wanted some 1 to check if its right or needs some change. if u can do this then i can send that sketch to u....
jst i hv few confusions which i couldnt find in google or any book.
So if u kindly help me then plz do let me know.
i have done jst use case diagram, if its okay then i wl draw class diagram.
Regards,
Bye
wahid
|
|
|
|
|
gwahid wrote: So if u kindly help me then plz do let me know
speak english* if you want people to :
1) understand you
2) help you
* : by english, i meant that using SMS-ed writing is not a regular way to ask a question, whatever language you use.
|
|
|
|