|
std::vector - code bloat...
CAtlArray
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
CAtlArray, hmm, I should keep it in mind for future use, since I don't need the serialization function here at all.
Thank you.
|
|
|
|
|
lol - you just don't give up, do you ? I've never used CAtlArray, is it part of WTL ? How complete is it ? That is, does it offer algorithms etc, or is it merely another container of the sort I could write in an afternoon ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
or is it merely another container of the sort I could write in an afternoon ?
For 10 points, explain how a "mere container" is a bad thing.
-c
Please stand by
|
|
|
|
|
I'm with Cristian. std::vector is the way to go.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Is the function implementation in the header file (or a #included inline file)? If it is in a .cpp file, then the compiler won't find it when instantiating the template, and so the function will be missing at link-time.
Dave
|
|
|
|
|
ah Yes. I implemented it in cpp file. After I delete the cpp and move the function definition to the .h file, everything is okay.
Thank you so much! I am so happy.
|
|
|
|
|
Thank god someone answered your QUESTION.
The style police should take a rest.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Like you, I have noticed that there are a lot of posters that preach certain methods for doing specfic tasks. While, I think it is OK to provide alternative appoaches to solve a problem...I also think that you should try to answer the question, as posed.
Gary Kirkham
A working Program is one that has only unobserved bugs
|
|
|
|
|
Be fair - I NEVER recommend STL unless I can also answer the question, or the question has been answered. I may not have got it right, but I had a guess.
And the MFC container classes are still a pile of fetid refuse.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
And the MFC container classes are still a pile of fetid refuse.
Is there an article you can direct me to that will show what you're talking about? If not, I see it as a great opportunity to once again demonstrate your overnight article-writing abilities .
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Yes, that was a major reason I wrote my article on std::vector, to point out all the things that it does that CArray will not. CArray is a perfectly good array class ( they are not hard to write ). But how do you copy the contents of a CArray into a CList or CMap ? STL containers provide a common iterator interface. How do you sort a CArray, or shuffle it, or any other common algorithm ? The stl comes with all sorts of algorithms, and the facility to easily write more.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Can this thing wait not only for socket events but my own as well?
Or how should I interrupt this thing? Or should I wait without and then
check for other stuff to do? What is the best timeout then? 1 Sec? 5 Sec?
Please HELP!
|
|
|
|
|
I know how to output an integer in MFC with AfxMessageBox and CString. Here I have no MFC and must use MessageBox. How do I make it show me the number? Lets say its a variable called a, and a=10;
Appreciate your help,
ns
|
|
|
|
|
use sprintf to format a char buffer and pass the buffer to MessageBox
Gary Kirkham
A working Program is one that has only unobserved bugs
|
|
|
|
|
Take a look at sprintf() in the msdn...
|
|
|
|
|
I'll check it out....
Appreciate your help,
ns
|
|
|
|
|
Hi !
I'm showing in a metafile one string normal, or rotated 90 ( landscape).
In normal mode, it calcs all the sizes, and the output string looks a little bit shrinked, but in the "rotated" mode, the string is shown not a bit shrinked, but GetOutputTextExtent, gives me the same value... so just the end of the string it's not shown...
I call ExtTextOut in this way:
dc.ExtTextOut(textRect.left, textRect.top, ETO_CLIPPED, textRect, str.c_str(), NULL);
Do you know how can I get the right value with GetOutputTextExtent for the rotated text ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
I've done something similar but I haev not used ExtTextOut, I've used DrawText...
else if (eElementTitol == ELEMENT_TITOL_EIX_VERTICAL)
{
FontTitolGeneral.CreateFont(-10,0,900,900,FW_BOLD,FALSE,FALSE,FALSE,
ANSI_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
DEFAULT_PITCH,"Arial");
pFontAntiga = memDC->SelectObject(&FontTitolGeneral);
RectangleCalculations...
memDC->DrawText(this->m_csTitolEixVertical, &rRectCalculatOcupatPelText, DT_BOTTOM);
memDC->SelectObject(pFontAntiga);
}
Hope this helps...
|
|
|
|
|
Hi!
I'm programming an application that sits in the systray and only becomes active when the user selects a menu item from the popup-menu when right-clicking on the icon in the systray.
Everything works fine, however a taskbar item is created for the time the window is being shown on the screen. (it disappears when the user hovers away from the dialog, and then the window and taskbar item is hidden again).
But my app has the WS_EX_TOOLWINDOW style, so why does my app have a taskbar icon?
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Have you verified with a program like WinSpector, or Spy++ that the app frame does indeed have the WS_EX_TOOLWINDOW style?
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I just checked it with Spy++ ...yes, it does have the WS_EX_TOOLWINDOW style
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have an MDI Application that Implements the Serialize method and I read data from the disk that are pertinent to the current document .
There are two scenarios where I do not want the view to come up and want to abort the process of generating the view .
1. User selects a File from the MRU list which is not present.
Application generates an error saying that the File isnt there But crashes as it further continues to load the View . Using debug i got the following Error
Reporting file I/O exception on Save/Load with lOsError = $2.
CDocument::OnOpenDocument returned FALSE.
2. I am implementing Serialize function in my Document class that reads data from a File. There might be an error condition that I encounter while I read . In such a situation I need to prevent the View from coming up .
Both the above mentioned scenarios are targeted at preventing the View from Displaying . How do I go about this ? Please help .
|
|
|
|
|
There was a suggestion from someone that I use DestroyWindow() when I encounter an error condition .
I tried using DestroyWindow in the OnInitialUpdate Function and my application crashes .
|
|
|
|
|
I have a SDI Application, i don't know if i accidently did something wrong but now my toolbar is disabled.
Even i created a new toolbar resource and attached application with this new toolbar, but when i run my Application, this new toolbar buttons are also shown as disabled.
This is urgent, please help
|
|
|
|