|
Christian Graus wrote:
The cook is a moron. You, on the other hand, are a smart guy
Hey, thanks. At least I now know I am smarter than the cook. Though that blasted doorman beat me to first spot
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
Nish [BusterBoy] wrote:
Is that possible?
You should read my article on std::vector. It does what you wnat it to, and as Thomaz has pointed out, you can use the [] operators to treat it like a dumb array if you desire.
The STL is calling you Nish, don't hold back....
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Christian Graus wrote:
You should read my article on std::vector
I better go read it properly...
Christian Graus wrote:
The STL is calling you Nish, don't hold back
LOL
I was just commenting on this very facet.
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=130099&tid=130068#xx130099xx
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
Hi Nish! Taking bout code bloat, take for instance the following sample code:
#ifdef USE_VECTOR
#include <vector>
#endif
int main(void)
{
#ifdef USE_VECTOR
std::vector<int> v;
#else
int * v=new int[1000];
#endif
for(int i=0;i<1000;++i){
#ifdef USE_VECTOR
v.push_back(i);
#else
v[i]=i;
#endif
}
#ifdef USE_VECTOR
#else
delete [] v;
#endif
return 0;
} Using std::vector instead of built-in arrays causes the release executable to grow from 20 to 26K. I find this acceptable (you might not).
What really introduces a huge amount of fat into the executables is the iostream library. But this is not part of STL.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks Joaquín. That sure does make sense.
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
Hello, I have a weird request from client:
- an application which when running, ad a custom
bitmap in all windows title bar, with a menu for some commands.
I could make a similarity with behavior of WinAmp for this request.
My application is not using MFC.
Can anybody point me on direction??
Regards
|
|
|
|
|
For painting the caption, use WM_NCPAINT. You'll probably have to code the menu yourself if you really want it to appear on the title bar.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi, I want to make a HTTP POST in C++, therefore I use the HttpSendRequest command. But I can't retrieve the html code, I need to bypass the proxy server. Does anyone know how this can be done??
CPPFreak......
|
|
|
|
|
Have a look at <a href="http://msdn.microsoft.com/workshop/networking/wininet/reference/functions/internetsetoption.asp">InternetSetOption</a> with dwOption==INTERNET_OPTION_PROXY .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I've looked at the options, but it still doesn't work. I've also tried different acces types with InternetOpen.
|
|
|
|
|
use chris maunders class here
I added the proxy code
just swipe the whole class
Bryce
|
|
|
|
|
hi
dose anybody know the code to increment text entered in a text box by 1?
Below is what i have done so far
m_copyed=m_typing;
GetDlgItemText(IDC_EDITDATA, m_typing);
m_copyed=m_typing;
{
/////////code needed here
}
SetDlgItemText(IDC_CHANGEDDATA, m_copyed);
Do u think changing each letter to a number adding 1 and then returning the text is possiable? eg abc=123 +1=234 changed back=bcd
|
|
|
|
|
This changes m_copyed in-place (if you need to preserve the contents of m_copyed do first a copy to some other string and perform the changes there):
for(int i=m_copyed.GetLength();i--; )m_copyed.SetAt(i,m_copyed[i]+1);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
That was very helpful
Thankyou
ps could i use the same code to return the values ie. working backwards to get to the orginal text
|
|
|
|
|
Hi!
How can I edit text in ListCtrl.I have only one column.
Thank you very much!
|
|
|
|
|
First, your control has to have the LVS_EDITLABELS stlye. Then handle the messages LVN_BEGINLABELEDIT and LVN_ENDLABELEDIT . Check your documentation for info about what these handlers are supposed to do.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
JySE.com is a new, free open forum for developers. Currently, we are searching for talented individuals to be moderators of our software development categories.
http://www.jyse.com
|
|
|
|
|
What are the moderators for???
Nish
Bow wow wow,
Yippee yo yippee yay,
My miniputt high,
Is now 30 yay.
|
|
|
|
|
forum moderators police the forum and in the beginning assists in answering queries until our forum has a large enough user base. They have the power to edit/move/delete posts and tries to make sure no one is abusing the forum.
|
|
|
|
|
hi
i need to stop the wave file which is playing in Media player programmatically.
if the code is generalised then its very useful.
Anyone have the solution for this?
Thanks in advance
regards
Halid
|
|
|
|
|
1) First off i'd like to get an opinion about creating cool code and leaving it all in one inclusive header.h package...?
CMemDC is great example...one simple little header no cpp files, less to look after...I know this sounds silly, but I find when my projects reach 20 or so classes, single includes look really appealing when i'm doing file managment. Despite your code inlining all the time I don't see why most code packages couldn't be written this way? What do you think...?
2) Flicker free scrollbars...this is starting to annoy me and i'm sure others have encountered this problem, how do you solve it...? Ownerdrawn scrolls...create them in seperate window...what hacks do you use...?
3) I've created a nifty custom control class originally derived from CView...but i'd much prefer CWnd derived...so I plan on converting. When you have a CWnd derived control how do you use it in a CView scenerio...? Do you throw it into a CFormView or actually convert from CWnd to CView...?
Just some questions/concerns I have for CP community in hopes of clearing some doughts(spelling) I have.
Cheers and thanx in advance!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
1) I guess leaving all the code in the .h file can make sense for short classes where everything can be inlined without much code bloat. Also, for templates this is the best option too (though not the only one). Apart from these cases, I guess having a separate .cpp file for the implementation is not that uncorfomtable for the user after all.
3) IMHO, the simplest way to use a CWnd -derived class as a CView of sorts is by following your first approach: create a CFormView and drop your class there as a child control.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanx Joaquín.
I just needed to hear that from someone other myself. Not that I have dual personalities or anything, but I certainly struggle with myself with such issues like, personal preference.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
|
What prevented me from suggesting CCtrlView as an alternative is the fact that the encapsulated window must have a distinct class name, which is not the case (by default) with CWnd -derived classes.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|