|
The content in CPP-Home is relatively good. But in all other places, they quickly move on to explain other inherited views. I hate them. I think too few people use SDI,CEdit views in this world . Thanks a lot for the explanation & link. I'll try to make use of the doc class. And will come back with another set of questions.
|
|
|
|
|
I just noticed that when running my application on vista with vista theme (aero glass on or off)
my CListCtrl doesnt hightlight the last selection item before it lost focus
even thought I enable "show selection always".
It still work when vista is set to use classsic style.
Is there any way to make "show selection always" work with vista theme with out custom draw the control myself ?
|
|
|
|
|
It probably is shown, but not very obviously. I've found previously that when a list loses focus, the selection is shown as very light grey, rather than the blue shading that's normally used.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hi
in visual studio 2005, i need to know whether a macro is defined when intellisense is processing the source so that i may distinguish between when the compiler is parsing the source code and when the intellisense is reading and processing it.
how it be useful? i need not to limit definitions of classes, variables, etc. for intellisense. although they may not be met sometimes when they're compiled, i need intellisense to meet them everytime. since there's only one definition of everything, there will be no conflict.
i hope i could describe what i'm looking for properly.
any idea?
|
|
|
|
|
If I understand what you're saying, you want Intellisense to see more than the compiler? Sounds bad to me, as then Intellisense would suggest things that wouldn't compile - which would be evil.
Anyway - don't think there's anything that does that (phew!).
Maybe if you gave a concrete example of what you want, we'd be able to understand better?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
ur right about when there're more than one definition of something, say a macro definition. but when i KNOW that i may reach to a definition which exists ONLY ONCE in the whole of my code, not being able to find it by Intellisense is bad.
|
|
|
|
|
Thanks for looking at my question,
I am wondering how I would use the ToUpper and ToLower functions on only part of a string in .net C++.
For example, I converted an inputted name to all caps for the purpose of comparing it. Now I need to display the name with only the first letter capitalized.
In short, I need to make "BRAD" to "Brad"
Note that the inputted name is not always the same, so however you can show me how to do this has to work with any inputted name.
Thanks for any help!!
|
|
|
|
|
TabascoSauce wrote: .net C++
Are you talking about the C++ that uses System::String? If so, there's a forum[^] just for that variant of C++ (and it's not this one).
In general, though, you'd identify the sub-string that you want to convert, extract if from the string, convert it and then re-insert it into the string. HTH!
[edit]In MFC, I'd do it like this:
CString CapitaliseName(CString const& upperCaseName)
{
return upperCaseName.Left(1) + upperCaseName.Mid(1).MakeLower();
}
[/edit]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for the help, sorry about the wrong forum, I'll repost there.
|
|
|
|
|
TabascoSauce wrote: sorry about the wrong forum
No problem - BTW - have a look at the System::String docs - I have a feeling you'll find the same methods on that as I used on the MFC CString class....
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I have a rich text edit control which I fill with a small amount of text at runtime. I've managed to slim the RTF down to:
{\rtf1\ansi\deff0{\fonttbl{\f0\fswiss\fcharset0 Segoe UI;}}
\viewkind4\pard\sa80\b\f0\fs24 Test string\par
\b0\fs16 Another string }
This displays the text in Segoe UI font. As this font is usually only available on Vista, I'd like to provide a list of font names in order of priority that the control would try to use in order until it found one that exists on the PC.
Is there a way to do this in the RTF description?
|
|
|
|
|
Don't think so - the RTF specification specifies that a single font name can be associated with a font number, not a set of fonts. Also, you can use only a single number when specifying a font in text, not a list.
I don't think RTF has any concept of font fallback.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks. Is there a quick way of finding out if a particular font name exists on the PC? Then I could at least have two RTF strings, one using Segoe UI, and another using Trebuchet MS for when Segoe UI is not present?
|
|
|
|
|
|
Hello,
i need to sort out this problem:
"The bubble sort represented in fig 6.15 of your text book is inefficient for large arrays. Make the following simple modifications to improve the performance of the bubble sort.
After the first pass, the largest number is guaranteed to be in the highest-numbered element of the array; after the second pass, the two highest numbers are “in place,” and so on. Instead of making nine comparisons on every pass, modify the bubble sort to make eight comparisons on the second pass, seven on the third pass and so on."
Could someone check my code? I should get an output like this but i don't :
After pass 0: 2 4 6 8 10 12 68 45 37 89
After pass 1: 2 4 6 8 10 12 45 37 68
After pass 2: 2 4 6 8 10 12 37 45
After pass 3: 2 4 6 8 10 12 37
After pass 4: 2 4 6 8 10 12
After pass 5: 2 4 6 8 10
After pass 6: 2 4 6 8
After pass 7: 2 4 6
After pass 8: 2 4
There is something wrong with the loop...
Thanks a lot!!!
raeiko
#include <stdio.h>
#define SIZE 10
int main ( void )
{
int a[ SIZE ] = { 2, 6, 4, 8, 10, 12, 89, 68, 45, 37 };
int pass;
int i;
int hold;
int NumOfComparisons = 0;
printf( "Data items in original order:\n\n" );
for ( i = 0; i <SIZE; i++ ){
printf( "%4d", a[ i ] );
}
printf( "\n\n" );
for ( pass = 1; pass < 9; pass++ ){
for ( i = 0; i < 9 - pass; i++ ){
if ( a[ i ] > a[ i + 1] ){
hold = a[ i ];
a[ i ] = a[ i + 1];
a[ i + 1] = hold;
}
NumOfComparisons = NumOfComparisons + 1;
}
for ( i = 0; i < SIZE - pass; i++ ){
printf( "After pass %d: %4d\n", pass, a[ i ] );
printf( "\n " );
}
}
printf( "Data items in ascending order:\n\n" );
for ( i = 0; i < SIZE; i++ ){
printf( "%4d", a[ i ] );
}
printf( "\n\n" );
printf( "Number of comparisons: %d\n", NumOfComparisons );
return 0;
}
|
|
|
|
|
1. You've got the loop bounds for pass and i wrong (hint - think SIZE)
2. Your print loop contents is incorrect
Apart from that, the algorithm's correct.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Don't like to do exercise for others
Anyway, the following is the fastest possible bubble sort I know;
bool sorted = false;
for (int i=1; i<N && !sorted; ++i)
{
sorted = true;
for (int j=0; j<N-i; ++j)
{
int k = j + 1;
if (A[j] > A[k]) {
int t = A[j];
A[j] = A[k];
A[k] = t;
sorted = false;
}
}
}
--
Arman
|
|
|
|
|
Hi,
I have created one button control dynamically. i have one requirement of need to visible the button whenever i have clicked on check box.
If i uncheck the check box the button control should be un visible..
Can any one help me out how it is possible in the MFC..?
Thanks
Venki
|
|
|
|
|
does this help?[^]
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Please don't tell the secret to everybody!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Can you help me out with a CEditView SDI sample? I tried to search the standard Superpad application.. I couldn't locate a downloadable version.
|
|
|
|
|
Disable and Visible are 2 different things.
So you have to be specific as to which you want to set.
'Cause reading a person's mind through this forum is impossible.
EnableWindow is for enable/disable and ShowWindow is for show/hide.
«_Superman_»
|
|
|
|
|
HELP PLEASE!!!
I have been stuck learning c programming for about 2 days. My code wont compile and here it is:
#include
main()
{
printf("Is your printer on (Y/N)?"); /*Request Y or N */
scanf(" %c",&ans);
if ((ans == 'Y') || (ans == 'N'))
{/*Gets here if user typed a correct answer*/
if (ans == 'N')
{printf("* * Turn the printer on now. * * *\n");
}
}
else
{
printf("You did not enter a Y or N.\n");
return 0;
}
-- I know that the problem is in line 4 but I haven't been able to learn how to use the "%c" because I cant find a book that completely explains it. PLEASE HELP
|
|
|
|
|
Where's char ans;?
You need to a good book for C like
"Beginnig C"
From Novice to Professional,
Fourth Edition
Ivor Horton
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I would strongly recommend this book - online tutorials can get you so far, but you really need a book to properly explain not only about the actual language itself, but the way in which to code certain tasks and explain methodologies and paradigms applicable with the language.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|