|
|
|
It seems that when I host a CListBox in a CDialogBar, in a CMDIChildWnd, whenever I hit the space bar, the selection index goes down one (I'm actually using CCheckListBox but found the behavior exists in the base class CListBox).
I tried handling OnKeyDown, and skipping the call to the base class handler when nChar == VK_SPACE but it still moves the selection index down one when space bar pressed.
When I use the CListBox in a dialog box, pressing the space bar does not move the selection index down.
Can anyone point me in the right direction to suppress the selection index change when pressing the space bar for a CListBox when hosted within a CDialogBar and CMDIChildWnd?
thanks
(Oops, I forgot to mention I'm using VC++ 2003 and I have an app written with VC++ 6.0 that behaves the same way. Also, Windows 2000 and XP have the same behavior)
|
|
|
|
|
Hi,
Currently I had a file type which will be open with a program i created. The file will be open in the normal windows environment by double clicking on the mouse or hitting the enter button.
Is there anyway to get the file name that open the program in the program?
Thanks in advance.
|
|
|
|
|
Yang Jiayi wrote: Is there anyway to get the file name that open the program in the program?
What?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
Do you want to get file name that you clicked on it?
|
|
|
|
|
It should be [somewhere(depends on the open command)] in the CommandLine argument, get the command line arguments from Main function argument or using the API "GetCommandLine". if its MFC Document-View App you can get from CDocument::GetPathName.
|
|
|
|
|
Yang Jiayi wrote: Is there anyway to get the file name that open the program in the program?
Use FindExecutable() .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Yang Jiayi wrote: Is there anyway to get the file name that open the program in the program?
Yes, the file name that open the program in the program is the program's file name.
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 someone Please send Me Some Sample code
in VC++ That READS and WRITES data to
STL MAP
Ive Just Gone Through some theory part...
But Dunno How to IMPLEMENT it...
Ive to Store Employee Info Of a COMPANY
USING STL MAP
|
|
|
|
|
Have you at least tried the CodeProject section about STL here[^]?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
|
Hi, first of all I do apologize if the question is already in the message board, but I cannot find it.
Here's my problem.
I've implemented a CDialogBar derived class (it makes common initializations to all the dialog bar I need); then I've derived from it a lot of classes each of which implements a specific dialog (created with the dialog designer); in one of them there are various controls (buttons, static text, list box, ecc.); when I add an event associated with a control (e.g. the OnClick event of a button) the designer creates the corresponding method in the class associated to the dialog. I run the program and the button is disabled.
If I move the entry ON_BN_CLICKED of the CDialogBar derived class' message map into the MainFrm's one, the button is enable, but when the event is fired and the method is called the 'this' pointer within the method points to the MainFrm instance (I would like that the reference is the CDialogBar derived class).
What's wrong?
Thanks in advance for any response.
|
|
|
|
|
Keep the event handler in the CDialogBar[-derived] class itself. To enable the button, you need to handle ON_UPDATE_COMMAND_UI like,
BEGIN_MESSAGE_MAP(CYourDialogBar, CDialogBar)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_UPDATE_COMMAND_UI(IDC_BUTTON1, OnUpdateButton1)
END_MESSAGE_MAP()
void CYourDialogBar::OnUpdateButton1(CCmdUI *pCmdUI)
{
pCmdUI->Enable(TRUE);
}
|
|
|
|
|
hi friends!
im using SDI Form based application with internet Rebar toolbar. i need to pass the values from that toolbar into main window (Cform view).
how?
please let me know as soon as possible.
thanks in advance..
Abdul Khathar
|
|
|
|
|
At this point you need to stop expecting more from App Wizard (done its job), you need to code now.
|
|
|
|
|
hi friends!
im using MFC SDI Application (with CForm view). i have also added two dialogs into my project. and those dialogs are used like toolbox.
the problem is if i try to send values from that dialog to main Form or another dialog. its giving obnormal termination error.
u please let me know wats the solution for that error.
thanks in advance.
Abdul
|
|
|
|
|
There's a nice toxcct's article about [^].
That article is actually undervoted (thanks to Mr. Univoter), but believe me, it is very good.
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]
|
|
|
|
|
|
Well, (IMHO) while the advanced articles are quite enjoyable for the few of us able to understand them, the (well written) articles for beginners are the most valuable here.
Unfortunately, if you write a good article (as, for instance, another of yours: , your "The Beginner's Guide to Using Enum Flags" - Disclaimer: I'm not the toxcct's publisher ) for beginners then you'll got a lot of attacks by the 'experts'.
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]
modified on Wednesday, October 29, 2008 9:19 AM
|
|
|
|
|
|
Khathar wrote: u please let me know wats the solution for that error.
Debugging would be the best possible solution.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: Debugging would be the best possible solution.
so plz u debug my code, plz sir, itz very urgent.
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]
|
|
|
|