|
Hi Maximilien,
Thanks a lot for your great effort.
Sarvan AL
|
|
|
|
|
Sarvan AL wrote: (1)what are are all different kind of C++'s (Turbo C++, Microsoft C++, Borland C++, ANSI C++... with proprietor name) are there in the industry?
A) There is only one thing refered as the programming language, which is named "the C++ programming language".
B) But the language, "C++" per se, keeps evolving thus there are various versions now.
B-1) In 1979 Stroustrup invented the language. But their team named it "C with classes".
B-2) In 1983 someone suggested "C++" which stands for better than C.
B-3) In 1985 Stroustrup published his 1st edition of the book "The C++ Programming Language".
B-4) In 1990 Stroustrup and Ellis published the book "The Annotated C++ Reference Manual", which became the basis of the ANSI C++ (1990) standard.
B-5) In 1991 Stroustrup published the 2nd Edition of the book "The C++ Programming Language".
B-6) In 1997 Stroustrup published the 3rd Edition of the book "The C++ Programming Language", which is the basis of ISO/IEC 14882:1997 (The C++ Standard).
B-7) ISO/IEC 14882:1997 was ratified on Nov 14, 1997.
B-8) In 2000 Stroustrup published the 3rd special edition of the book "The C++ Programming Language".
B-9) ISO/IEC 14882:2003 was ratified in Dec 2002. This is the latest language standard.
C) All the other names for example: Microsoft C++, Microsoft Visual C++, Borland C++, Borland C++ Builder, Borland Turbo C++, Intel C++, GCC (GNU Compiler Collections), ... are products or software applications, in other meaning: they are the development tools, the compilers and linkers.
Sarvan AL wrote: (3) Which one is used more ?
Currently, Microsoft Visual C++ and GCC are used more. But actually you can't say so. Each development tool has its own capability. When I have to code 16-bit programs, I need to pick up some old tool like Microsoft Visual C++ 1.5.
Sarvan AL wrote: (4) Which among them are free?
It is well known that GCC is free.
Microsoft Visual Studio 2005 Express has been free recently.
Sarvan AL wrote: (5) For freewares, how to get the updated libraries ?
Taking GCC for example, download the latest version from GCC website or Cygwin website.
Maxwell Chen
|
|
|
|
|
Hi Maxwell,
Thanks a lot for your detailed explanation.
Sarvan AL
|
|
|
|
|
I have a VC6 app (no manifest resource) which has a window with several children; The main part of the window is covered by a scrolling edit window (but with only a vertical scrollbar). The SB is 'blue' with etched horizontal lines, and is (presumably) done by the edit control non-client stuff as normal (it's a regular edit control).
I want to put several windows underneath the edit control, such as tab selection stuff (think Excel workbook), and a horizontal scrollbar under around half the window (again, think Excel).
However, when I create the scrollbar, it appears as a 'standard grey/gray' boring old scrollbar (not like the one in the edit window).
Is there a relatively simple way I can make it render in a more modern style? I'm presuming themes here, but being a retro kind of guy (hey, I have clients who still run Windows 95 and 98 ) I haven't done anything with them yet; any pointers, hints or samples welcomed.
Incidentally, does anyone have a link to the 'ThemeExplorer' sample mentioned in MSDN Oct 2001, which looks like it might be useful at some point?
(And yes, I am moving to VS2005, slowly. I didn't realise my code was so non-compliant with more recent standards...
Steve S
Developer for hire
|
|
|
|
|
Some times the SetWindowTheme() function may help u
nave
|
|
|
|
|
Um, yes, sometimes it might. I should, however, have checked that my manifest was being correctly compiled into the resources, which, as it turned out, wasn't, because I'd used what I assumed would be a predefined value for the ID, rather than '1'.
Irritatingly, the standard controls I was using (list view/richedit/tree) all had visual styles, so I didn't spot it straight away....
Steve S
Developer for hire
|
|
|
|
|
CString Str1 = "Some STring here";
CString Str2 = "Some thing here too";
if (Str1 == Str2)
{
}
Any problem using this comparison??? than using its member function to compare???
|
|
|
|
|
No, it works because the operators are overloaded. But be carefull it is a case-sensitive comparison.
For more details, see the MSDN[^]
|
|
|
|
|
On using the if(Str1==Str2)
You are comparing the pointers to character arrays.
That is you are comparing the memory addresses and not the string objects with overloaded comparison operators
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
-- modified at 7:03 Friday 5th May, 2006
|
|
|
|
|
_AnShUmAn_ wrote: You are comparing the pointers to character arrays.
no. these objects are CString s, which class overload the operator==.
the code actually does :
if (Str1.operator==(Str2)) ...
but this doesn't work with C-Style strings
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
_AnShUmAn_ wrote: You are comparing the pointers to character arrays
Wrong, Str1 and Str2 are CString, not char*. CString class has an overloaded == operator which is equal to the Compare member function.
|
|
|
|
|
|
What actully compared..?? see the flow of calling sequence of functions
int Compare( PCXSTR psz ) const throw()
{
ATLASSERT( AtlIsValidString( psz ) );
return( StringTraits::StringCompare( GetString(), psz ) );
}
//for MBCS
static int __cdecl StringCompare( LPCSTR pszA, LPCSTR pszB ) throw()
{
return _mbscmp( reinterpret_cast< const unsigned char* >( pszA ), reinterpret_cast< const unsigned char* >( pszB ) );
}
//for Unicode
static int __cdecl StringCompare( LPCWSTR pszA, LPCWSTR pszB ) throw()
{
return wcscmp( pszA, pszB );
}
So finally what is the result..??
"const char *" are compared..
Knock out 'T' from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
No, no and no
Look at the code he provided !! We are talking about CString classes! Those classes have an overloaded == operator (geez, I think it will be the sentence I wrote the most today ) thus this code is perfectly legal.
And, in what you posted:
static int __cdecl StringCompare( LPCWSTR pszA, LPCWSTR pszB ) throw()
{
return wcscmp( pszA, pszB );
}
You think that this is equal to
return (pszA == pszB);
The content of the wcscmp function compare the contents of the pointers ! So there is a huge difference.
Did you understood the question in the first part ?
-- modified at 8:32 Friday 5th May, 2006
|
|
|
|
|
|
*be patient, everything will be fine soooon*
|
|
|
|
|
What i want to say that, The core functionality behind the == comparison
I aggred with Cedric Moonen that "The content of the wcscmp function compare the contents of the pointers"
The wcscmp function compares pszA and pszB lexicographically and returns a value indicating their relationship
Knock out 'T' from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
I think you didn't really understood what was going on because of the language (english, I mean). I didn't say that the == operator wasn't calling the compare function. The question was if there will be a problem if this is used in this way (with the == operator).
Now, how it is handled inside the class, we don't care (this is 'hidden' to the end user). The important thing is that it works .
Now when you say the the function compares the pointers (it is what I understood from your previous message) I say no! It's not because the Compare function receives the two pointers that it will compare the addresses.
So, I don't understand why you posted your previous message in fact .
|
|
|
|
|
The purpose of my previous post is just information what actually logic behind the comparison
Not to oppose to any one as you are doing.
And don't warry about my english
Knock out 'T' from CAN'T
You 'CAN' if you think you 'CAN'
-- modified at 9:32 Friday 5th May, 2006
|
|
|
|
|
inline int CompareNoCase(LPCWSTR lpsz) const
{
// ignore case
return _wcsicmp(m_pchData, lpsz);
} // MBCS/Unicode aware
is what the definition of the CompareNoCase function that can be found in chstring.h file.
So aren't we passing a char * to this function.
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
I think you are missing the important point: we are not discussing about char arrays (so something like char* MyArray or char MyArray[5] ) but about CString classes (MFC classes), which is a huge difference. The CString class has an overloaded == operator (take a look at the link I supplied).
|
|
|
|
|
The == operator internall use the compare function
see the implementaion of operator==
_AFX_INLINE bool AFXAPI operator==(const CString& s1, const CString& s2)<br />
{ <br />
return s1.Compare(s2) == 0; <br />
}
so if wants to know if two strings are equal using compare function u have use like this
if( Str1.Compare( Str2) == 0 )<br />
{<br />
}
nave
|
|
|
|
|
I saw this coding in one sample...
My doubt is already "this" is a pointer.then why they use another pointer in this.
CTrans & CTrans::operator=(CTrans dData)
{
m_bClose = dData.m_bClose;
m_sData = dData.m_sData;
return *this;
}
|
|
|
|
|
This function is like a constructor where the values being passed are copied into the variables of the object with which this constructor is called.
So to reflect all the changes properly you need to take the values into a pointer and return 'this' for the same.
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
-- modified at 9:29 Friday 5th May, 2006
|
|
|
|
|
Anu_Bala wrote: My doubt is already "this" is a pointer.then why they use another pointer in this.
It's because it is returning a reference so *this is required. This is called De-Referencing .
If the function was modified as follows
CTrans* CTrans::operator=(CTrans& dData)
{
...
return this;
}
This means we are passing the address of this class. Hence no *this is required.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|