|
I think there's some < and > missing !
Max.
|
|
|
|
|
reply, yeah I forgot to use the gt and lt symbols in the post, I fixed it - thanks for pointing that out
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
You need to "fill" the type for the vector template, that's all:
std::vector<Bar> barVec;
|
|
|
|
|
I did - I just forgot to use the gt and lt symbols in the html post - what you have in your reply i have in my code and it still bombs out. Weird
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
You're missing a semicolon after the class definition.
Dave
|
|
|
|
|
oops, I am a sloppy poster - I fixed hte original post - in the code I had the closing semi-colon and still it gave me the error
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
This isn't supported in V6 and I even think V7.
Solutions?
Move the class outside of the function.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Looking up the error code explains the problem.
But here is something to think about: Is the reason you are getting the error code because the "template code generator/expander" will only generate code once for a given template and template-argument(s)?
Meaning, given the following code:
<br />
class CClassA<br />
{ <br />
std::vector< long > m_vecLongs;<br />
};<br />
class CClassB<br />
{ <br />
std::vector< long > m_vecMoreLongs;<br />
};<br />
-Does the "code generator" evaluatate and generate code twice, once for each std::vector< long > or does it generate the code one time, and reuse it when it sees that it has already generated the code for that specific template/template-argument before?
If the latter, it explains why the error occurs: there would be no way for the "code generator" to know if a local type called Bar is the same as another local type called Bar someplace else. With external linkage, it has the mangled name (which uses classes/structs) to identify one over the other. I do not believe that local identifiers get mangled.
Just a thought...
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.5 Now!]
|
|
|
|
|
This is explictly banned in the standard: local classes cannot be used as template arguments (so this time it is not VC++ the one to blame).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Ahh, OK thanks - good to know.
But now I can't make fun of VC6 for this anymore. Damn...
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
All members of Bar are private. Could this be the problem?
|
|
|
|
|
I am trying to print contents (as part of Print Preview ) of a TreeCtrl in my MDI application which has a CTreeCtrl member in the CFormView . I might need to print many pages(printer context). After I exceed 1 page height while printing, how do I force printing on the next page ? Also when I scroll pages all contents are lost ? why ?
What should I be doing to prevent this ?
I am basically implementing writing to the device context in my CView's OnPrint method !
Please help
|
|
|
|
|
Use CDC::EndPage() and CDC::StartPage() to the end the current page and start a new one.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Where should i be specifying these ? i tried putting StartPage in OnPrint before the function call to populate the preview and EndPage after this function ends !
|
|
|
|
|
|
I am able to print all pages of Print Preview , but I need to reset my point of printing whenever the user clicks on the Print Preview toolbars . How can I trap these events such as next page, zoom in and zoom out .
|
|
|
|
|
You don't. The CPrintInfo object passed to you should contain the page # Windows wants you to print.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello...
I'm developing under win. XP Pro, but my programs must run under win. 2k Pro, the fact is that I'm trying to resize a property sheet and under XP I've done it, I don't understand why under 2k I get the resized window not shown properly... (it gets displaced to the upper left corner...)
the code that I use is very simple:
<br />
rectPS.left = 0;<br />
rectPS.right = ::GetSystemMetrics(SM_CXSCREEN);<br />
rectPS.top = 0;<br />
rectPS.bottom = ::GetSystemMetrics(SM_CYSCREEN);<br />
<br />
this->SetWindowPos(NULL, rectPS.left, rectPS.top, rectPS.Width(), rectPS.Height(), SWP_NOZORDER | SWP_NOACTIVATE);<br />
could you explain me what is happening?
Thank you in advance
|
|
|
|
|
You are telling it to make the window as big as the screen positioned at the top/left. Why it isn't doing this on XP is the mystery. What did you expect this code to resize the window to?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Does either system have multiple monitors (or at least multiple video cards installed and active)?
Also, if you are trying to "maximize" the Property Sheet, you should not use the values returned by SM_CXSCREEN and SM_CYSCREEN , you should use the rectangle returned by SystemParametersInfo( SPI_GETWORKAREA ) so that you do not cover things like a non-hiding taskbar, or any other desktop bars (a surprisingly common error).
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.5 Now!]
|
|
|
|
|
yes, my system has a matrox g550 with two monitors, and I want to hide the taskbar and all the other stuff... (but in the other hand I'm testing my app in my laptop (that has only one monitor ) and that is running under Win 2k Pro.)
I've been using that way to resize windows since I need to hide those system resources... and it has worked properly for me...
What I can't understand is that when I use the same code under XP Pro. the property sheet is being resized OK; but under 2k it's also being resized OK, but is not positioned where it should be, it is positioned more to the left and to the upper corner than it should be (an undesired offset/displacement of the position)...
I've noticed that if I resize the taskbar the problem changes (then in one hand if I make the taskbar higher the window will appear more displaced, and in the other hand, if I make the taskbar lower, the window is showed more properly...)
Could you explain this to me?
Thank you in advance.
|
|
|
|
|
Joan Murt wrote:
[...] Could you explain this to me?
Not without running a test, which I cannot do right now, sorry. I have to complete a build by this weekend.
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.5 Now!]
|
|
|
|
|
Hi! I hope someone can help me on this. Is there a way to extract each byte from an integer variable in C++ (4 bytes) ?
thanks, peter.
|
|
|
|
|
There are lots of ways to do this:
<br />
<br />
union ByteToInt<br />
{<br />
unsigned int i;<br />
struct bytes<br />
{<br />
unsigned char a;<br />
unsigned char b;<br />
unsigned char c;<br />
unsigned char d;<br />
} bytes;<br />
};<br />
<br />
<br />
ByteToInt b2i;<br />
<br />
b2i.i = 0xFF00FF00;<br />
cout << b2i.bytes.a << endl;<br />
<br />
- not syntaxchecked or even compileable but I hope you get the picture.
Another method:
<br />
unsigned int i = 0xFF00FFcc;<br />
<br />
unsigned char b1 = static_cast< unsigned char >( i );<br />
unsigned char b2 = static_cast< unsigned char >( i >> 8 );<br />
unsigned char b3 = static_cast< unsigned char >( i >> 16 );<br />
unsigned char b4 = static_cast< unsigned char >( i >> 24 );<br />
<br />
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Basically strip off the other bytes with a mask, then shift the value to fit into a BYTE.
int value;
BYTE b1 = (value & 0x000000FF);
BYTE b2 = (value & 0x0000FF00) >> 8;
BYTE b3 = (value & 0x00FF0000) >> 16;
BYTE b4 = (value & 0xFF000000) >> 24;
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|