|
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]
|
|
|
|
|
Dont problem I can compile it for you.
|
|
|
|
|
How did you create the dialogs?
And how did you try to set/get the values?
Are you sure that the dialogs are created at that time?
|
|
|
|
|
use PostMessage to send messages between the different windows. In the message you can update the windows. Think about a global data object which data is represented by all windows.
Greetings from Germany
|
|
|
|
|
You can use of like this code for dialog box
CMain* m_Main=(CMenu*)GetParent();
m_Main->yourcontrols();
|
|
|
|
|
How Can I compress the Avi to RLE8 ?
As I want to play avi using CAnimationCtrl provided by MFC, and it's requirements are-
- avi should be in RLE 8 compression or not compressed
- avi should be of 8-bit color depth
Please help to solve this problem...
|
|
|
|
|
maheshbhoir.home wrote: How Can I compress the Avi to RLE8 ?
1. Use a video editting tool.(may be the one that created the current file)
2. There is AVI file management support in Windows SDK in the VFW category such as [AVISave^] and lot other AVI file functions. And there was a sample WriteAVI, when i searched for it i got [avigenerator^] from google.
BTW, for complex formats use DirectShow (instead of CAnimateCtrl) that can display any format that are installed on the target machine.
modified on Wednesday, October 29, 2008 7:18 AM
|
|
|
|