cdialog

Open CDialog from Java using JNI

Hi everybody, I have an application that needs to open a CDialog written inside a DLL. The problem is that when DoModal() is called inside the DLL, the program crashes with: "Debug Assertion Failed!". Does anyone have any idea how can i get the CDialog opened? Thank you! ...

Custom tooltip with a WS_POPUP dialog

Hi, I want to create custom tooltips where I can put any kind of controls. I have derived from CDialog and used the WS_POPUP | WS_BORDER styles. I also add the CS_DROPSHADOW style in the OnInitDialog to get the tooltip shadow. Then I manage myself the WM_MOUSEHOVER and WM_MOUSELEAVE events to show/hide the tooltips. I display the tool...

How to SetFocus to a CButton so that the border and focus dotted line are visible?

I created a simple dialog-based application, and in the default CDialog added three buttons (by drag-and-dropping them) using the Visual Studio editor. The default OK and Cancel buttons are there too. I want to set the focus to button 1 when I click button 3. I set the property Flat to true in the properties for muy buttons. I coded...

CDialog not closing when two buttons mapped

Visual Studio 2005, C++, Windows XP. I have a CDialog with a single button, which calls a function like so: BEGIN_MESSAGE_MAP(Foo, BaseDlg) //BaseDlg inherits from CDialog ON_BN_CLICKED(IDBAR, Bar) END_MESSAGE_MAP() The dialog box closes when its 'X' is clicked. I change the above code to: BEGIN_MESSAGE_MAP(Foo, BaseDlg) //BaseD...

Command-line dialog tool for Windows

I need a dialog tool similar to cdialog (or whiptail), but one that will work on Windows. I have MinGW and compiling something from source is no problem, but both cdialog and whiptail, the only ones that I know of, contain code that is UNIX-specific, and so they will not compile on Windows. Are there any alternatives that I can use? I...

.NET + COM changed keyboard routing behavior

Hi all! I have a problem so strange that I hardly can put an adequate title to it. In short: I have COM object written in MSVC++/MFC with a dialog derived from CDialog. On that dialog I have three child "user controls" - windows derived from plain CWnd. When I use this COM object from a variety of places, everyhing works as I expect. ...

MFC CDialog::Create fails

I'm having problems with some code to create a CDialog based window. The code was working fine last week. The only changes I made was replacing a C++ deque with a hash array. I had commented out the line of code with the Create method being called to allow me to skip loading the window. Now the code doesn't create the window at all a...

Create a CDialog in the corner of the screen

I have an MFC application that creates a CDialog. I'd like this CDialog to not show up in the middle of the screen, but rather off to the side of the screen so its barely visible or even minimized would be good. How can I do this? ...

Convert a modeless dialog to modal at runtime

I have a dialog (CDialog derived class) that can be used in two different ways (edition mode and programming mode). When the dialog is open to be used in programming mode it is a modeless dialog that it is used for modifying the main view (kind of a toolbar). When it is open in edition mode the user can change the configuration of the d...

CDialog not main frame descendant

Is there a way to make a dialog (CDialog) not descendant of the main frame? If I don't specify a parent window at creation time the parent window is the main application window. I have tried to use SetOwner and SetParent with a NULL parameter but didn't work. So is there any way to make a dialog not child of the main window or any othe...

How to send a string via PostMessage?

Inside my app, I want to send a message to a dialog from a different thread. I want to pass an std::exception derived class reference to the dialog. Something like this: try { //do stuff } catch (MyException& the_exception) { PostMessage(MyhWnd, CWM_SOME_ERROR, 0, 0); //send the_exception or the_exception.error_string() here }...

I can't seem to add a column header to a list box in an inherited MFC dialog. What's wrong?

Hi, I have a CStdDlg thats inherits from a CDialog class. In the CStdDlg dialog, I have a list box (m_lcList1), edit box (m_ceEdit1), a radio button(m_rbButton2) and buttons OK, Cancel and Button1. I am trying to create another class named CDerivedDlg that inherits from CStdDlg. I want to use everything in CStdDlg but from the CDeriv...

How to get window handle from a CDialog derived class ?

Hi All, Is there a way to retrieve window handle from a CDialog derived class (like CWnd::m_hWnd member) ? Thanks ...

Visual C++ 6.0 - OnInitDialog in a Derived CDialog class not working

Hi, I have create a simple MFC appwizard dialog project. I used the Class Wizard to create a new class called CMyDlg based on CDialog. Then I went to the Message Map screen and doubleclicked on the WM_INITDIALOG entry to automatically create a CMyDlg::OnInitDialog() handler. The problem I have is that CMyDlg::OnInitDialog() will not cal...

Anchor buttons in a dialog when using SW_MAXIMIZE

This should be a simple one: I have a CDialog with 2 buttons. The dialog is always opened in full screen (No title bar \ Status, etc...) using m_pMainWnd->ShowWindow(SW_MAXIMIZE); I want my buttons to snap to the edge of the screen. There are no resizing or anything. ...

How to display a non-modal CDialog?

Can someone say me how I could do a No Modal Dialog in MFC's Visual c++ 6.0 for show it? I wrote this, CDialog dialog; if (dialog.init(initialization values...)) dialog.DoModal(); But it blocks my application for show the dialog. I dont know if exists any method or other way to do. Thanks ...

Put MFC CDialog in a WPF form

Hi, We are porting an MFC application to WPF, and will probably won't have time to port the entire application. The MFC app has many CDialog-based windows, and we are thinking of leaving some of these windows in MFC, and show them inside a WPF window, so we can control their modality from WPF. Is there an easy way to accomplish that? If...

Infinite Thread that may or may not run a CDialog each loop

I am working on a MFC project where I need a separate loop that will run continually or once every few seconds, and each time it may or may not need to run a Dialog to get some input from the user. I was thinking of using AfxBeginThread, but from what I have read about it, it doesn't really work with a continuous loop. ...

Passing data between subforms of type CDialog

I have a MS Visual C++ 2005 project where I am trying to have a main dialog box with a section devoted to displaying selectable subform dialogs boxes. Each subform will be of the same size but have a different layout. The selection is performed using a combo-box control. I searched on the best way to implement this functionality and I...