|
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_
|
|
|
|
|
The bug is the semicolon ; following the for statement: an empty statement is controlled by the for expression while the code block inside the curly braces {} is always executed.
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.
|
|
|
|
|
I suspect you're suffering from a change in the syntax between VC6 and Visual Studio 2003 C++ combined with a stray semi colon. The scope of counters in for loops (i in your case ) has changed so that if they're declared in the loop they can't escape from the loop. You possibly have 2 i's happening here in different scopes which is to say the least. I now use this syntax to try and be both 'correct' and compatible
<br />
int i = 0;<br />
for( ; i < m_NumberOfObjects; i++ )
{<br />
m_ListObjects[i]->DoStuff();<br />
}<br />
<br />
for( int i; i < m_NumberOfObjects; i++ )
{<br />
m_ListObjects[i]->DoStuff();<br />
}<br />
The extra ; has caused the intended loop code to happen only once and declaring the i outside has let you get away with it Perhaps that's why they changed it.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
thanks all for your replies, obviously just the stray semi-colon (couldn't spot it after looking at the code for ages, post the question on here and spot it straightaway always the same!)
Andy,
|
|
|
|
|
I know the feeling.
Therefor I sometimes use one of my colleagues to wine about some extreme strange bug.
They are willing to help. Once I show them the piece of code and start explaining what it suppose to do. I start swearing at my own stupidity. Time on time i have found the bug before they do.
codito ergo sum
|
|
|
|
|
mcsherry wrote:
int i = 0 ;
for ( i = 0 ; i < m_NumberOfObjects ; i++ ) ;
{
m_ListObjects[i]->DoStuff ( ) ;
}
there you are. The semi colon in the second line is causing problems to you.
sorry, i didn't see that you figured it out by yourself.
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
The compiler should have given you a warning about that semicolon. If not, turn warnings back on.
|
|
|
|
|
I don't think so Mike. That looks like completely valid C code with the semi-colon in there.
That one would drive me nuts if I didn't see it right away in my code LOL
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|