|
eli15021979 wrote: (we don't
want that the list control will have to know what kind of items it "holds"...).
I'm not sure you understood what I meant.
In a virtual list control, you store everything about the items somewhere else. The control
keeps index and state information only. When the control needs to draw it sends a notification
requesting the text for each item and subitem. From the looks of your sample code, you already
have that information in a list container, so there's no reason to store it in the control as well
(like you are doing now).
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi all,
I'm using the "CIniFile Class for C++ - A robust cross platform INI file class" wrote by Todd Davis and it's working and all but for some or other reason I keep getting garbage in the ini file. For example:
ç[TEST]
ÿMyKey=MyValue
Can anyone help ??
Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: Can anyone help ??
Doubtful, since you've not provided anything useful.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Right ... So write the following lines of code:
CIniFile IniFile;
IniFile.Create("test.ini");
IniFile.SetValue("MyKey","MyValue","MySection",FileName);
And when I open the ini file I have garbage in the file. I haven't edited the .cpp and .h files provided by the article.
Useful enough ??
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Have you made any other changes (besides here) to the CIniFile class?
Have you stepped into the SetValue() method?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
No I haven't made any changes, the only 'thing' that differs is my IDE. I'm trying to use it in C++ Builder 2006. But I can't see anything wrong with that (besides that Builder suck). Yes I have stepped into SetValues , but I'm struggling to debug ... not use to Borland debugging environment.
Oh well, I'm sure I'll figure it out ...
Thanks David
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
have you tried compiling in both UNICODE and non-UNICODE to see if that matters ?
|
|
|
|
|
I would like to create an application which is basically a transparent window, or something similar, which has "objects" on it, which are images which can be dragged around the screen, and clicked on, and double clicked on etc... However, I am not sure how to implement this..
I usually work in pure C/C++ however if there are some C++ classes which allow for this i would be willing to try them out..
Thanks for your help!
--PerspX
|
|
|
|
|
hi everyone
i m using microsoft textbox 2.0 on visual c++.
i m trying to add lines to my text but i don't want to write all over again, i just want to add more text to the existing ones.
i know i can rewrite everything by using "textbox.settext("bla bla")" method
but i want to add them.i know in visual basic there's this option by using the "&" sign. does anyone know?
thanks in advance
|
|
|
|
|
I've got the complete row selection extended style working now, but would just like to know the correct method to programmatically set a row to be selected as though a user had clicked it so that it can be turned all blue.
cheers
|
|
|
|
|
ldsdbomber wrote: ...but would just like to know the correct method to programmatically set a row to be selected...
Use the LVM_SETITEM message.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Is that via a SendMessage David? I've not used that before very much
|
|
|
|
|
ldsdbomber wrote: Is that via a SendMessage David?
Yes, if you are not using MFC.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You can use:
SetItemState(index,LVIS_SELECTED | LVIS_FOCUSED,LVIS_SELECTED | LVIS_FOCUSED);
|
|
|
|
|
|
I have a property sheet with wizard style.
At one place, I need to disable the Finish button. The code doesn't work and the Finish button is enabled.
But if I put a message box before calling the SetWizardButton routine, it works.
I tried with invalidate method so as to refresh the current windows, but I guess I am missing something.
Any pointers?
evil triumphs when good people sit quiet..
|
|
|
|
|
misha_grewal wrote: The code doesn't work and the Finish button is enabled.
What does the code look like?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
oK I digged into the problem a little bit
Is it a message queue problem?
Code ===
pWizard->SetWizardButtons(PSWIZB_BACK);
CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH);
if (pButton) {
// this call doesn't work
pButton->EnableWindow(FALSE);
}
but if you put a message box before the call, it works, as in
if (pButton) {
AfxMessageBox(_T("text"));
// this call now WORKS
pButton->EnableWindow(FALSE);
}
Code ends ==
On the other hand, if I call a "ShowWindow" method instead of EnableWindow, it works fine with or without the message box.
What happens in EnableWindow?
|
|
|
|
|
misha_grewal wrote: CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH);
if (pButton) {
// this call doesn't work
pButton->EnableWindow(FALSE);
Why aren't you using:
pWizard->SetWizardButtons(PSWIZB_DISABLEDFINISH);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks much
it works with this call
i m really stupid
|
|
|
|
|
In my Visual Studi 2003 C++ project I've got a weird bug. I have a 'normal' for loop:
int i = 0 ;
for ( i = 0 ; i < m_NumberOfObjects ; i++ ) ;
{
m_ListObjects[i]->DoStuff ( ) ;
}
where m_NumberOfObjects is a static int (member variable) within the class.
The problem is the for loop seems o ignore the entry criteria so if i = 0 and m_NumberOfObjects = 0 is still goes in (even with i = 1 and m_NumberOfObjects replaced with a 0)
Has anyone came across this? or know what is going wrong?
TIA,
Andy
|
|
|
|
|
doesn't matter I'm an idiot, stray semi-colon
|
|
|
|
|
mcsherry wrote: stray semi-colon
Don't let 'em get away from you. They're feisty little buggers
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: Don't let 'em get away from you. They're feisty little buggers
|
|
|
|
|
You should not put the ";" after the for loop Dear...
and you don't normally come across such issues if you know how does a for loop work:->
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|