|
Dear all,
I have MFC application Which As button named Download file ,which pop up a user dialog named "file download". which provides buttons to browse file and start downloading the selected file.
When i press download button it call a dll function to perform the download operation and waits for download to complete.what i need is to close the dialogbox(named file download)whenever the file download completed messagebox pop up .
Manjunath S
GESL
Bangalore
|
|
|
|
|
|
If it's a modal dialog, call EndDialog() . If it's modeless, call DestroyWindow() .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
and you can se WM_DESTROY
whitesky
|
|
|
|
|
Using the designer to create the main form for an application generated the following code in the .cpp file:
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA;
Application::Run(new DataForm(lpCmdLine));
return 0;
}
The DataForm class has a button which generates a new form:
linkedForm = new LinkedForm() ;
The LinkedForm class exists in the same namespace as the DataForm class.
What needs to be done to allow this child form to see public methods in it's parent, since a DataForm ptr cannot be declared globally? Are there any examples of parent/child form communications of this nature?
Thanks,
MrHonus
|
|
|
|
|
seems this is not a standard MFC program, u might post it to Manage C++/CLI forum.
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
|
Is it CI/C++?
It was created using Visual Studio and .NET, so I guess the answer is yes.
|
|
|
|
|
I have created an ActiveX Control using VC6 with MFC Automation built in. I'm able to add the control to a VB6 form and run it successfully(for most parts : I'm not able to observe any of the events fired within the control). Anyway, the real problem is when I try to use the ActiveX control in a VC6 Dialog based app. it crashes on me at design time, right after I 'Insert ActiveX Control' into the Dialog. It triggers a 'Debug Assertion' within the MS VC6 IDE and then shuts down the IDE. Verrrry frustrating...
I think I may have narrowed it down to the OnDraw method for the control:
Within the Control I have a member called 'configPanel' derived from CDialog, which is used to control runtime settings for the Control. It contains several components: buttons, edit box, check boxes, etc... I've implemented the OnCreate for the Control, as well as for the child 'configPanel'. I'm using the MoveWindow to size and position the 'configPanel'. See code below. This works fine in the VB6 container but won't even place the component in the CDialog container at design time. Note: the code below will work using the GDI functions, but bombs with the 'MoveWindow'. How do I go about rendering the child dialog 'configPane' and its control components(button, edit box, etc...)????
<br />
void CSomeCtrl::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)<br />
{<br />
CBrush brBackGrn(RGB(255,100,100)); <br />
pdc->FillRect(rcBounds, &brBackGrn);<br />
<br />
CRect rcPanelRect(rcBounds.TopLeft(),CSize(rcBounds.Width(),rcBounds.Height()/4));<br />
<br />
}<br />
Someone please enlighten me!
You are my last, greatest hope...
MissingLinkError
|
|
|
|
|
I am not realy sure the problem but I think you should move:
<br />
CRect rcPanelRect(rcBounds.TopLeft(),CSize(rcBounds.Width(),rcBounds.Height()/4));<br />
configPanel.MoveWindow(rcPanelRect,TRUE);<br />
to OnSize event handler.
|
|
|
|
|
I have a printing application which works quite good for some years now.
It uses a modless abort dialog which can be used to abort the banded printing process. The dialog uses the well known "keep the message pump alive" method which is e.g. described in this article (http://www.codeproject.com/threads/TemplatedLengthyOperation.asp[^].
So the printing process queries an abort method of the dialog continuously which keeps the message handling alive and checks the abort button. This works very good for years now.
But now I want to use a progress bar and an abort button in the toolbar of the print preview view instead of the dialog - but I am not sure if this will work with the same technique like in the abort dialog. I could not find any information about it. Everyone seems to use a dialog.
Has anyone an idea if this works?
|
|
|
|
|
Printing in a background thread and when the UI thread tool button is clicked us PostThreadMessage to inform the printing thread of the abort.
|
|
|
|
|
Thanks for your answer. Of course this would work, but I try not to change how the internal printing routine work. So want to avoid using a thread if it is possible.
|
|
|
|
|
Why is it not compiling?
Errors:
1. (16): error C2079: 'file_op' uses undefined class 'std::basic_fstream<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
2. (16): error C2078: too many initializers
3. (17): error C2228: left of '.eof' must have class/struct/union type
4. ..test.cpp(17): fatal error C1903: unable to recover from previous error(s); stopping compilation
test.cpp
#define MAX_LINES_PER_SENTENCE 1000
#include ".\SentenceAr.h"
#include ".\SentenceList.h"
#include <string>
using namespace std;
void main ()
{
char strOutput[MAX_LINES_PER_SENTENCE + 1] = {""};
char strFileToRead[MAX_LINES_PER_SENTENCE + 1] = {"C:\\temp\\testfile.txt"};
int x = NULL;
fstream file_op(strFileToRead,ios::in);
while(!file_op.eof())
{
file_op.getline(strFileToRead,2000);
cout <<strOutput;
} file_op.close();
cout <<endl;
;
file_op.close();
}
The code does not compile even when I try to declare strOutput and strFileToRead as 'string' including the <string>.
Jon
|
|
|
|
|
You forgot to #include <fstream> at the top of your test.cpp file.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
Hi,
Can u please say how to get data(text) in the grid control of a property page into another property page.
Thanks in advance.
tejaswini.
|
|
|
|
|
Hey Everyone,
I am developing a application in MFC in which I have 3 CBitmapButton; 1 big BitmapButton over that other 2 BitmapButton but the problem is that when the focus is at the button which is in background, the other 2 button which are on foreground disappear. I want that the 2 button in the foreground always appear in the foreground so that user can see those everytime.
Can somebody help me out with this problem.Thanks for reading.
Vab
Vab
|
|
|
|
|
You could try to make the two buttons a child of the big button.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
hi all,
i want to develop one application in VC++.
A win32 dll can make use to call a MFC exe and to pass some argument value to that exe.At last the MFC exe can show the argument values passed by the dll.
A messagebox should be show the argument's value ...
thanks...
invoke(arguments)
Dll --------> MFC exe ---->MessageBox(arguments..)
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
Why don't you simply return the value from a function ? You call the function from the dll and store the result so it can be displayed in a message box.
It is difficult to help you because you don't provide a lot of information about your problem.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
hi,
thanks for ur reply..
i want to call a MFC exe from another exe , so that i used shellExecute() to run another exe, at the same time ,i need to pass some parameter values to the another exe, which has to display the values in their corresponding edit box.
for e.g., if i passed "NAME","NUMBER","MARK1"
the another exe display those above information in their edit box.
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
You can get access to the arguments that the DLL passed via m_lpCmdLine .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
thanks for ur reply..
i want to call a MFC exe from another exe , so that i used shellExecute() to run another exe, at the same time ,i need to pass some parameter values to the another exe, which has to display the values in their corresponding edit box.
for e.g., if i passed "NAME","NUMBER","MARK1"
the another exe display those above information in their edit box.
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
So what exactly is your question? I've already told you about m_lpCmdLine .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|