Visual C++ :: FTP With Progress Dialog
Nov 13, 2012
For a project I'm working on, I need to be able to download a file from an FTP server and store it to a predetermined location with a predetermined name. No user interaction should be needed. Because the file is rather large, and I need the main program to remain responsive, this is going to need a progress dialog.
I could write all this myself and use the MFC wininet wrappers (CInternetSession et al) to do the downloading, but... Explorer already has this, and IE has such a dialog also. It doesn't seem unreasonable to assume those dialogs are available via some API.
Is a "FTP download with dialog" available as a windows API, or do I really need to write all this myself ?
View 2 Replies
ADVERTISEMENT
Oct 5, 2014
I'm having problems with progress bar when using a big number in set range. For numbers below 50000 it works very well but for big numbers like 100.000 it doesn't work, it makes 2-3 rounds of animation
Code:
int number= 50000; // 50k works well but if i put 100k it won't work (it will animate 2-3 rounds instead of complete one)
progressbar1.SetRange(0, number);
progressbar1.SetStep(1);
for (int i = 0; i < number; ++i) {
listcontrol1.InsertItem(i, _T("whatever"));
progressbar1.StepIt();
}
What's wrong with the code ?
View 5 Replies
View Related
Apr 17, 2013
I've created a modeless dialog from my main dialog as follows:
Code:
m_pContainerDlg = new CDlgContainer(NULL, this);
m_pContainerDlg->Create(CDlgContainer::IDD, GetDesktopWindow());
m_pContainerDlg ->ShowWindow(SW_SHOW);
This container dialog creates a child dialog which I show inside the container
Code:
BOOL CDlgContainer::OnInitDialog(){
// Create the child dialog and show it
m_pChildDlg = new CChildDlg(this);
m_pChildDlg->Create(IDD_DIRECTORY_DIALOG, this);
return FALSE;
}
From my child dialog I then create a modal dialog when a user clicks on a button
Code:
CChildDlg:: CChildDlg (CWnd* pParent /*=NULL*/) :
m_pParent((CDlgContainer*)pParent), {
} void CChildDlg::OnBnClickedBtn() {
CMyDlg MyDlg;
INT_PTR iResult = MyDlg.DoModal(pParent);
}
My problem is that the CMyDlg is modal but to the main dialog and not to the container or the child dialog.
View 3 Replies
View Related
Dec 9, 2013
What I want is simple: I want to catch a dialog box!
The dialog box pops very frequently in a website. We have to put a username and password and press OK. I checked with spy++. It doesn't have any child windows. So catching the dialog box with windows API is ruled out. It must be a HTML dialog. I have to get DOM COM interfaces of the dialog.
Another option may be to make an add-on to get the interface to IWebBrowser2 and get the events fired. The title of the dialog box is "Authentication Required". If the events will be fired for that dialog box, I can check the title using IHTMLDocument2::get_Title.But will the events be fired for HTML dialog box? How to catch that desturbing dialog box.
View 2 Replies
View Related
Feb 13, 2014
How can I create a dialog as a DLL ? I have a SDI MFC app (CView is based on CFormView) and from a button I want to load a modal dialog, but that dialog must be developed as DLL ... I didn't find something that fit my needs on internet ... P.S. I have only VC6 !
View 14 Replies
View Related
Sep 11, 2013
I was wondering how can we know how many items exist in a dialogbox? If there any way that i can get the items ID in a dialogbox by having just the dialogbox's object or handler? Or any way that we can get a dialogbox content by coding.
View 6 Replies
View Related
Mar 25, 2013
I have an mfc dialog of size 1280 X 1024 and when i change the resolution to 800 X 600, after adding scroll bar, it don't show the entire dialog contents, Seems like it clips the 800 X 600 portion.
I have handled VScroll and HScroll. It works fine for higher resolutions!
View 1 Replies
View Related
Dec 23, 2013
Normally, menu bar resides below the title bar. See attachment MenuBarOriginal.JPG
Is there a way that we can position the menu bar? For example,place it on the side or anywhere on the dialog box?
MenuBarModified.JPG is some sample of menu bar positions that I want to place.
I want to do this on a dialog box.
View 6 Replies
View Related
Feb 12, 2014
I need to pass a variable to a dialog box.
Code:
Doc* pDoc;
Dialog dlg;
int input = dlg.DoModal();
When I call dlg.DoModal() I need to somehow pass the pDoc into the dialog box. Everything I need the variable for is taking place inside the oninitdialog function. Is there anyway to pass the variable to that function?
View 2 Replies
View Related
Jul 10, 2013
I forget how to know when mouse is over controls in dialog.. I want to show a message in status bar when mouse over each control...
View 1 Replies
View Related
Aug 22, 2014
I have a ListCtrl on my dailog. It has a report view. In my case I have selected first row with left click of mouse and entire row is displayed in blue color as selection (as per expected) and when I right click the second row of the listctrl it displays the menu which I have added to it and the selection remains with the first row.(as expected). I have already overridden the ListCtrl class.
I want that on the right click of second row the selection should remain with the first row but this second row also should be displayed with dotted line border.
View 1 Replies
View Related
Oct 5, 2012
i open child dialog from a dialog( which is launched from a toolbar of a window) after editing i close the child dialog, after closing child dialog shadow is retained on window but not on the parent dialog. Later when i close the parent dialog the child dialog shadow disappears. (issue exist only when i edit in child dialog)
View 14 Replies
View Related
Feb 28, 2013
I want to pass some parameters to a dialog. I am trying to pass a struct as LPARAM in CreateDialogParam. How to access this structure from ONOK for example?
Code:
struct DlgParam{
std::wstring IEDllPath;
CString folderName;
};
[Code] .....
View 7 Replies
View Related
Jul 3, 2013
I have a slider control on a dialog box. I am playing a video file and slider moves according to the video elapsed. Suppose I have set the slider range to 100. Now till some point say 90, the slider moves to the point wherever I click the mouse. but at the last point in between some range say 90 - 100 (to the end of the slider), if I click the mouse button anywhere, slider jumps to the end.
I am using a TimeLine control where user can add more than 1 video (1, 2, 4, 8, 10 , 50 etc......), If I use only one video, slider moves as per the video progression.....Issue arises when I add more than 1 video and click on the start button, slider starts moving....Now when I drag the slider to any position or I click the mouse button anywhere on the slider control, slider thumb moves to that position and immediately jumps back to some other position. This is the Issue, I am facing.
share some sample code where slider is moving with the video showing the progress of the video.
I want to implement a functionality similar to VLC player. Wherever user clicks the mouse, slider moves to that point.
View 13 Replies
View Related
Apr 8, 2013
If it is possible, I'd like to know how to intercept messages sent to controls on a dialog. I'm working on a large application with a large number of dialogs, each with a number of controls on the dialog. I need to be able to intercept messages sent to these controls so that I can determine if the controls really need to take action on these messages. I could subclass each control and override the specific event handlers but due to the volume of controls in the application this could take a very long time, will introduce risk if controls are missed, and will increase maintenance costs. What I want to do is create a class which is derived from CDialog and each of the dialogs in the application would then be derived from this new dialog class. The new dialog class would intercept messages sent to any control on the dialog and if the dialog decides that the control should do something then the dialog will pass the message on to the control.
example:
CExistingDialog is derived from CNewDialog is derived from CDialog
CExistingDialog has a number of controls. When the code in CExistingDialog calls CWnd::EnableWindow on one of these controls I want CNewDialog to intercept the message, determine what should be done with the message, and then pass it on to the control.
I'm not very familiar with the messaging framework. I've tried overriding a few of the methods of CNewDialog but none of them ever receive the message to enable the window. I assume this is because the message is sent directly to the child window (the control).
Is there any way to intercept these messages? I don't know much about hooks either but is this a possible option?
View 8 Replies
View Related
Jul 17, 2014
I have been playing around with property sheets/property pages and have been successful in getting them to work in a secondary dialog by calling the property sheet using DoModal().
How to get the property sheet to display on the main dialog of a dialog application.
I am using VS2008 and CMFCPropertySheet and CMFCPropertyPage.
View 5 Replies
View Related
Feb 28, 2013
I have made a simple Pane class so that I can encapsulate a winapi Dialog.
I call it as:
Here the code I have, but it displays no dialog.
Here is what I do in main:
Code:
Pane(&hDlg, hInstance, nCmdShow);
while((ret = GetMessage(&msg, 0, 0, 0)) != 0)
{
if(ret == -1)
return -1;
if(!IsDialogMessage(hDlg, &msg))
{
[Code]...
View 7 Replies
View Related
Nov 26, 2012
I have been told to show some text document when our application starts up, it is an EULA. They gave me a word file and I saved this file in a .rtf format. I then wish to show this in a dialog box and found this on code guru: [URL]
Which seems to be a sub-class that will do all the formatting for me. So I use that class and then load in the .rtf file, using their setRTF method I just get an empty text box.
I just want to be able to show this formatted, somewhat pretty text from this document in my application as close as I can to the original document. Is there an easy way to do that? I could turn it into plain text, but I think that my boss would not be happy about that.
The problem was that I needed the text box to be marked multi-line.
View 1 Replies
View Related
Jan 16, 2013
How can I call a dialog , which is present in a seperate Win32 resource DLL .
View 4 Replies
View Related
Mar 11, 2015
I am having a strange problem trying to display a dialog from a UI thread. The dialog simply fails to display. I have a function DisplayFlashBox(), which creates the UI thread:
CUIThread* CIMUIHelper:: DisplayFlashBox(const CString &sMessage, const int nInstrumentUID) {
CUIThread *pThread = new CUIThread();
pThread->SetString(sMessage);
pThread->SetInstrumentUID(nInstrumentUID);
pThread->CreateThread();
[Code] .....
The dialog doesn't display. When I tried debugging, I found the OnInitDialog() method of CIMFlashBox class doesn't actually return. Very strange. I tried calling the DoModal() method instead of Create, but doesn't display the dialog either.
View 5 Replies
View Related
Aug 30, 2013
I am trying to use CDHtmlDialog in a MFC dialog based project.
What i want to achieve is pretty sample. Have one image, one button and one text box in the HTML page.
And then dynamically change this based on a timer. i.e., there're multiple images in the folder and it will change every seconds. Once the button is clicked, the timer stops and no more image changes. Same time when image changes the text in the text box also should change.
I know this is pretty simple, but for some reason i am not able to make the image even display in the dialog.
I am using Visual Studio 2012 in Windows 7 machine.
View 4 Replies
View Related
Mar 6, 2015
I have a little demo of a bitmap button that simply uses CButton and resource bitmaps in an MFC dialog app. The intent is to click on the button and have the bitmap image change. My code works ok the first time around, but crashes on repeat clicks. I have interpreted this as failure to properly delete the HBITMAP object, though I could be mistaken. In any case the app works ok in Release configuration but violates assertion in Debug.
Code:
ASSERT(m_hObject == NULL); // only attach once, detach on destroy[code]
// dialog header
// Attributes
protected:
HBITMAP m_hBitmap1;
HBITMAP m_hBitmap2;
[Code] .....
View 9 Replies
View Related
May 20, 2014
I'm using VS 2012. Installed MYSQL 5.6, C++ Connector 1.1.3. Created a sample table using mysql. Now i like to create a connect between mysql and MFC dialog. Using this, i was try to connect.
Server Explorer -> Data Connection -> Add Connections ->MYSQL Database -> Addconnection
To get the connection, i want to enter the connection settings like:
server host name = localhost, user name =root, password=
If I pressed any letter in the keyboard means add connection dialog was closed automatically.
How to connect mysql(localhost) with MFC Dialog?
View 14 Replies
View Related
Apr 26, 2014
I have a tabbed dialog with a couple of Separate dialogs. I created classes of CDialog for each dialog. Im trying to get the text from the edit control from the tabbed dialog and it appears in a message box when I press a button on the main dialog.
Code:
myDialog test;
test.UpdateData(TRUE);
CString bla = test.m_edit1;
test.UpdateData(FALSE);
MessageBox(bla,bla,MB_OK);
The m_edit is a variable of CString for the edit box
it gives me a error and crashes.
How do I get the text from the other dialogs edit control?
View 8 Replies
View Related
Mar 3, 2014
I have an existing dialog, having activex control, list control, tree control checkbox, button etc.... I added one radio button and executed the program. whenever i am clicking on the radio button, the dialog hang/crash. Even simply dragging one radio button from toolbox and executing also behaving in the same way.
View 2 Replies
View Related
Jan 19, 2013
Is there some document, that describe the sequence of actions, that result in displaying of a Dialog Window from a .DLL.
One important detail - the Dialog Window is created via resource/toolbox inteface.
Below is code from some example (which works), that displays simple window (with client area inside it).
In this code the window class is ctreated inside of application class.
Here is extract from application class:
Code:
class CMyWindow : public CFrameWnd {
CStatic* cs;
public:
CMyWindow();
};
CMyWindow::CMyWindow() {
Create(NULL, L"MyWindow", WS_VISIBLE, CRect(0,0,200,200));
[code].....
Where is my mistake ?
View 14 Replies
View Related