|
Thanks it worked.
It was obvious!
Best regards,
Alexandru Savescu
|
|
|
|
|
Hi,
I'm doing something similar, but i don't have luck
<br />
typedef bool (*func)(CClient *, CPacketBase *);<br />
typedef std::map<long, func> CHandlerMap;<br />
and I declared a function called
<br />
bool CPacketHandler::prcLogin(CClient *pclt, CPacketBase *pak)<br />
{<br />
....<br />
return true;<br />
}<br />
I tried to insert the function into the map like:
<br />
m_HandlerMap.insert(CHandlerMap::value_type(1001, &prcLogin));<br />
The error I got is :
error C2276: '&' : illegal operation on bound member function expression
Error executing cl.exe.
|
|
|
|
|
The member function has to be static.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I tried, but still the same.
|
|
|
|
|
Alexpro wrote:
MyMap.insert (pair ("aaa", f1); // error here
and the error is
Be more type specific than pair(..)
Use this statement-
MyMap.insert(MyMap.value_type("aaa",f1));
HTH
Vivek
|
|
|
|
|
hi, i have a CEdit control and I want to change the default scrollbars colour. i also do not want it to have the Winxp style on windows xp, but do not know how to do this.
My control is binded to a class called ECEdit, which is derived from CEdit, I want to put the code for he scrollbar in ECEdit.
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
Someone could advise a good math or 3D book , considering that my math is weak (I didn't give a damn on college) .
It have to prepare me to do full blow 3d programming and learning first the basics then the more advanced math concepts.
Anyone had read these this books ? Are they good ?
Mathematics for 3D Game Programming & Computer Graphics
3D Graphics Programming: Games and Beyond
Thanks
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
I have read 3D Graphics Programming: Games and Beyond, but i don't think that i really got anything usefull from it.
I also read the much too tiny chapter on 3D in the "black art of Java Game Programming", and it actually gives a better overall description to get you started (and it has an OOP view as opposed to the other book which uses C).
But what really helped was the tutorials in basic vector math that my girlfriend paced me through, and these links:
http://chortle.ccsu.ctstateu.edu/vectorLessons/vectorIndex.html
and
http://members.tripod.com/gamecode/tut/
The first link is the best tutorial on math that i ever saw besides my girlfriends tutorial (and you can't have her, she's MINE!).
The second link points to some implementation guides that are only helpfull when you understand the basics.
Some books tell you that "it really isn't nescessary to understand the math behind this, just use the formulas in good health", don't buy it!.
When you understand the math your'e seeing it all so much clear.
"It could have been worse, it could have been ME!"
|
|
|
|
|
Thanks Jansen for the links, they appear to be cool
jan larsen wrote:
I have read 3D Graphics Programming: Games and Beyond, but i don't think that i really got anything usefull from it.
Risking this book from the wishlist ... next ...
jan larsen wrote:
besides my girlfriends tutorial (and you can't have her, she's MINE!).
You jealous guy
jan larsen wrote:
When you understand the math your'e seeing it all so much clear.
Yeap, that was my intention , to really understand the math , I don't like books that throw things at me without explanation ...
Thanks again , Jansen
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
Foley and Van Damme's book on graphics is one of the standards. it does 2d, 3d, ray tracing, fractals, etc..
-c
Cheap oil. It's worth it!
|
|
|
|
|
Chris Losinger wrote:
Foley and Van Damme's book on graphics is one of the standards
Okay , it so appears
Adding it to wishlist .... done ... 100% processed
Thanks Chris
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
LONG first = 1022230205L;
LONG second = 1000L;
LONG third = first * second;
cout << third << endl;
This should result in 1022230205000 but it returns 27988552 instead. Am I missing something here?
I've tried DWORD also, same result.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
The largest LONG is 2147483647, so your calculation causes an overflow.
|
|
|
|
|
Could be something like that. But I've tried DWORD as well.
I thought that the maximum was 9.223.372.036.854.775.807
The maximum you gave is for integers, no?
Can a long be negative?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
The maximum value of a DWORD is 4,294,967,295. You're having an overflow.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Sorry guys.
I've noticed that a long only uses 4 bytes.
I'm a java programmer and a long is 8 bytes in java
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
why have you put an L at the end of the numbers? could that be the problem?
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
If you don't put the L, the compiler assumes that's an integer. We add the L to reserve a bigger memzone.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
oh...didnt know that
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
I don´t think that the L will reserve a bigger memzone.
It only says the compiler that the number is to been seen as long, a typ-cast.
Try to trace every variable after assign it!!
|
|
|
|
|
You've overflowed the LONG. Try __int64.
|
|
|
|
|
Why do all the languages take there very own amount of bytes for the data types? java-long=8 <-> c++long=4 ...
Very confusing
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Type sizes in C++ are implementation-dependant. The standard only dictates the minimum size. However, for most (all?) 32-bit compilers, sizes are just like in VC++.
The next version of C++ standard most likely will include types with fixed size, like int32 , int64 etc., to aid in the developing of cross-platform code.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
If I use a double, that will do too?
A double is 8 bytes, msdn says so.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|