|
Hi Dev,
As you given a solution
SetIcon(NULL, FALSE);
SetIcon(NULL, TRUE);
For both Big ICON and Small ICON. I am still able to see an Empty White ICON.
Any suggestions please.
Thanks & Regards,
Uday.
|
|
|
|
|
yes.. i apologize, for a resizing dialog box, it shows a white icon, whenever the system menu property of dialog box is true. What about loading a complete transparent icon and set it as dialog icon?
Others may have solid solutions to give you..
|
|
|
|
|
It seems the icon is displayed because of WS_SYSMENU style. So, one option would be to disable System Menu style.
|
|
|
|
|
Hi,
Can anyone tell me how to export a CListCtrl data into pdf/doc format?
Thanks
|
|
|
|
|
|
Hi Rajessh.T.S,
Thanks for your reply.The link you have given me for word document is in C#.I havent worked on C#.Please suggest me some links in C++/VC++.
Thanks
|
|
|
|
|
|
i can't convert int to CString.. need help pls..
here is my code, i want to print whatever the value of count is on a STATIC TEXT Control..
count += 1;
atoi(count);
m_StaticText.SetWindowText(_T("try lang = ")+ count);
i got------>
error C2664: 'atoi' : cannot convert parameter 1 from 'int' to 'const char *'
thanks ahead..
|
|
|
|
|
you may use:
CString str;
str.Fomat(_T("try lang = %d", count);
error is because your syntax for atoi() is wrong.
i think it is itoa() that you really intended to use
|
|
|
|
|
in these code :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_StaticText.SetWindowText(_T("try lang = ")+ count);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
you can not add a string value to a integer value.
|
|
|
|
|
|
Each item in the list box has a bind data( set with the func 'SetItemData') , if I delete the item which who's index is 7(based zero), so now , is the new 7 indexed item has the last eighth item's data or seventh 's data ?
|
|
|
|
|
the new 7 indexed item will be the old 8th item(with its data set with SetItemData). list box will handle this internally whenever you delete an item from it.
If you set a pointer to some dynamically allocated memory as SetItemData(index, ptr), take care to delete that memory before removing the list box item, if you don't need that memory again.
|
|
|
|
|
Thank you! I just know where are you come from?
|
|
|
|
|
you may email the forum members for further activitiees.. no such discussions here please.
|
|
|
|
|
Hi I want to find the number of comma(,) in particular string.
Like char* str = "a,b,c,d,e". So how many commas are there in str ?
Thanks
|
|
|
|
|
Use strchr in a loop.
char* str = "a,b,c,d,e";
int count = 0;
for (;;)
{
str = strchr(str, ',');
if (NULL == str)
break;
++str;
++count;
}
|
|
|
|
|
std::count is your friend. It does exactly what you'd expect it to do from it's name. The only problem you're likely to have is working out where the end of the characters in memory are, but if you're feeling lazy bung the characters in a std::string first:
std::string s( str );
std::cout << "There are " << std::count( s.begin(), s.end(), ',' ) << " commas in " << s << std::endl;
Cheers,
Ash
|
|
|
|
|
char c;
int commas=0;
while((c=*str++)!=0) if (c==',') commas++;
|
|
|
|
|
const char *p = "a,b,c,de,f,";
int c = 0;
for (;*p;c+=(','==*p++));
|
|
|
|
|
Ahh, the joys of C++. Did you make it so complex on purpose, or is all your code written like that ?
|
|
|
|
|
That was classic Kernighan and Richie C!
Sheesh, youngsters of today...
Whippersnapper!
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
[Untested]:
std::string str("a, b, c, d, e");
int count = std::count(str.begin(), str.end(), ',');
or if you insist on C-style strings:
int count = std::count(str, str + strlen(str), ',');
|
|
|
|
|
The inline ASM version is still missing, anyone?
|
|
|
|
|
I think is interesting to compare the solutions.
Note: The "trivial" algorithm is to scan the string and count the ','.
Now:
Superman: Just did that using CRT: no additional data are added, and the strchr function is made walking from ',' to ','.
Aescleal: Made an elegant use of STL algorithms.
But: a constant literal is copied into a temporary std::string (probably with also a dynamic array allocated by the class itself), creates two temporary iterators, passing them to the std::count algorithm that just do the loop.
Luc Pattyn: Use a more concise loop.
Chris Losinger: same. Very elegant, but more cryptic.
Nemanja Trifunovich: Same a Aescleal, but also propose to use std::cout with const char* instead of std::string::iterator -s, eliminating the need of the conversions.
Moral of the story: I'm starting to believe that STL - and in particular "strings" are over-evaluated.
The more coincise and elegant (together) is probably the second Nemanja proposal.
But one question makes me wonder:
Suppose I'm a coder asked to do this task, and suppose I know the algoritm, but i'm not expert in the language libraries: what should be fastest for me?
- Read the STL documentation -probaly in strict alphabetic order- trying to guess is there can be something that can help me in counting the ',' (I'm luky the <algorithm> header come as first and the count function is one of the firsts ... estimated time: 15 minutes - but supposing I already know the "iterator"/"container"/"algorithm" model)
- Just write
unsigned count_chars(const char* s, char d)
{
unsigned c=0;
for(unsigned int i=0; s[i]; ++i)
if(s[i]==d) ++c;
return c;
}
actual time 2 minutes! And the best of efficiency (no spurious allocation and copies)
<sarcasm> Do yo understand the beauty of STL ?!?</sarcasm>
(NOTE: using indexes, instead of incrementing pointers, is actually more efficient when translated into todays processor's code)
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|