|
Need to turn of the ellipsis for the ListView. I am creating the List View with No Header at runtime. I get ellipsis in XP style, when using the manifest file. If I don't use the manifest file, then it shows the whole string.
How can I turn of the ellipsis.
Any help is appreciated
|
|
|
|
|
What is the meaning of turn of ellipse?
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
By Ellipsis I mean three dots (...)
|
|
|
|
|
I assume you mean 'turn off' rather than 'turn of', since that makes no sense.
This is happening because with no manifest the control is drawing slightly differently, and has more client space. The easiest solution would be to make the control slightly bigger, and/or increase the column width.
Steve S
|
|
|
|
|
Yeah...sorry for the typo. I tried increasing the column width but still no avail.
No matter how big the Columnwidth still I couldn't remove the ellipsis.
I even tried wrapping the text in two lines after calculating the number of characters that will fit in the specified columnwidth by calling the function: GetTextExtentExPoint
Then I tried using the SetWindowTheme function which is sitting in uxtheme.dll
I still have the same result.
Any help
|
|
|
|
|
my classview info won't show up anymore and everytime I try to compile my program I get an error telling me that I can't access a protected member variable (value). but it's declared like this:
public:
char *value;
void release();
it was protected at once, but now it's not and I've rebuilt all a number of times and nothing seems to work. can anyone help?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Can you trim the class, including the member-variable access, down to just a few lines that exhibits the problem?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
thanks, I got it working. I was trying to cheat and mess with a class that I didn't write and change the access to public, but I found a right way to do it, so I don't have to worry about it. Thank you anyway!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
If I have a pointer to an object foo is there anyway to tell if that object actually exists?
Say I only want one window open at a time.
void
foo::openWindow()
{
static foo* ptr = NULL;
if (ptr)
ptr->closeWindow();
ptr = this;
...
}
So, the second time through this code I want to know if ptr is still valid, because it may have been deleted without my knowledge.
I know there are other ways to do this, but I want to know if I can figure out if ptr still exists.
I've tried adding a ptr = dynamic_cast<foo*>(ptr); , but this throws an exception if ptr has been deleted, and I'd rather not use a try block.
Thanks in advance
|
|
|
|
|
I completely fail to see the purpose of your code, but that aside, you can simply check whether the 'this' pointer is NULL.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Yeah but if you create
foo *a = new foo();
foo *b = new foo();
a.openWindow();
b.openWindow();
delete b;
a.openWindow();
I know I could create a member and set it to this in openWindow and NULL in closeWindow, but I do not want to have a member for this.
If you change the code to use a dynamic_cast and put a try-catch(...) around it this will work as is, but the powers that be don't like try-catch, so I'm not allowed to use it.
|
|
|
|
|
patnsnaudy wrote:
but the powers that be don't like try-catch, so I'm not allowed to use it.
Not being allowed to use try..catch is wrong, but so is a design that throws exceptions based on bad coding, so on aggregate, I'm with the 'powers that be'.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
It's good coding hygiene to set a deleted pointer to NULL . This will help prevent run-time errors and could make your code simpler.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
If there's some function call out there that tells you if a spot in memory is valid that'd be a real easy way of doing this. But I don't know of one.
My suggestion. Make ptr a static member of the foo class. Then, in your foo destructor, if ptr == this, set ptr = NULL.
Tim
|
|
|
|
|
I know I can do this, but I did not want to add a member for this.
Thanks though!
Jerry
|
|
|
|
|
TFrancis wrote:
If there's some function call out there that tells you if a spot in memory is valid that'd be a real easy way of doing this. But I don't know of one.
How about:
IsBadReadPtr()
IsBadCodePtr()
IsBadStringPtr()
IsBadWritePtr()
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Add an operator HWND to the class that returns the window handle and call ::IsWindow.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
There is already a function to return HWND I think, if this is derived from the window class (I'll have to check tomorrow at work). ::IsWindow is a great suggestion! I was looking for a magical function that would look at a piece of memory and tell me if it had been deleted, but IsWindow should work.
Thanks
|
|
|
|
|
it will not work if the pointer to the dialog is deleteed.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
By it will not work does that mean that it will crash if the pointer has been deleted?
|
|
|
|
|
yes,it will very unpredictable, it may crash in some cases and it will work in some cases. but then working with deleted pointer is very bad idea.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
To determine if a pointer points to readable memory, use the IsBadReadPtr() function. If it returns FALSE, then the pointer cannot be read.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I just created a static pointer to the window and set it to this in the openWindow function and NULL in the dtor.
Thanks
|
|
|
|
|
Hi all.
Using TCHAR is fine, but i wanted to know if there would be a way of turning UNICODE on for my application (#define _UNICODE does nothing). Needed for testing (I fear LOTS of errors ).
Please help.
|
|
|
|
|
Have you also defined UNICODE (in addition to _UNICODE )? Make sure they are both defined as close to the top of stdafx.h as possible.
With both defined, TCHAR will resolve to unsigned short . Otherwise it will resolve to char .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|