I'm trying to execute a stored procedure on SQL Server from an MFC based C++ program. The stored procedure does get executed properly, but an exception is thrown in my program, a CDBException with a message of "Function sequence error". Tracing through the MFC source code for CRecordset::Open, the exception is thrown from MoveNext - th...
I have a CButton object called mouseCtrl, and in the DoDataExchange function, I have the following:
DDX_Control(pDX, IDC_MCCHECK, mouseMode);
Somewhere else in my program, I would like to be able to call a function/method of mouseMode so that I can retrieve the IDC_MCCCHECK id macro properly. Is there a function in MFC that can allow ...
How can we increase the the height and width of a cell in List
It is created using Listcontrol MFC
...
I currently have my project running two separate threads (one for MFC operations, like views/formviews, application window, etc., and one for an infinite while loop in its main function). However, for certain situations, when I run my program in debug mode, I have noticed that one of the threads' exit status was a 1 (in other words, it r...
Our core application is built in MFC C++, but we are trying to write new code in .NET, and have created a User Control in .NET, which will be used on an existing MFC Dialog.
However, when a unexpected/unhandled exception is thrown from the User Control, it causes the MFC app to crash (illegal op style), with no ability to recover.
I've...
Hi,
(I'm using VS++2005)
I put edit box control (with ID - ID_edit_box) on my dialog, and associate (with handler wizard) two varibles for it: control (c_editbox) and value (v_editbox) variable. Also I associate handler function OnEnChangeedit_box with that edit box control. Suppose that we may enter just one digit in edit box, and tha...
Recently for convenience I set up Windows XP to "Automatically move pointer to the default button in a dialog box" (via Control Panel => Mouse => Pointer Options).
For most dialog boxes (e.g. Windows file delete confirmation, Outlook empty deleted items) Windows will follow this directive and automatically position my cursor above the d...
I'm writing an application in C++ that runs as a system tray icon. When the application initially starts up the main dialog loads up and takes focus, which isn't the behavior I intend it to have. Is there a way to load the system tray icon without having the main dialog load up?
...
Hello,
I am working in MFC and I am trying to capture a bmp of the desktop.
I am using GetDC(NULL) to do this but it seems it ignores special skinned windows. It seems to ignore windows drawn with UpdateLayeredWindow. This behaviour seems to be happening only on Vista x64 and XP. I have also tried GetWindowDC with the desktop HWND but t...
I am trying to build an install CD with a custom MFC application set to autorun when the CD is inserted.
The instructions are included as a simple html page with images and links to PDF documents, all of which are located on the CD.
In the past I'd used the following to open the html page with the default browser:
ShellExecute(NULL, "...
For a static Win32 library, how can I detect that any of the "Use MFC" options is set?
i.e.
#ifdef ---BuildingForMFC---
....
#else
...
#endif
...
I'm trying to make my child dialog box to be created as a member of the main application class as follows:
class ParentWindow : public CWinApp
{
public:
// Other MFC and user-implemented classes before this line
MiscSettings activeMiscSettings;
public:
ParentWindow();
~ParentWindow();
// Overrides
virtual BOOL Init...
I am following this tutorial:
http://www.generation5.org/content/2001/sr00.asp?Print=1
Right off the bat it asks me to use the MFC Application Wizard to create a new project. It turns out that it's not included with the Visual Studio 2008 Express.
Is there any way that I can download it so that I can use it to continue the tutorial? O...
I'm trying to add a menu item such that it acts like a check mark where the user can check/uncheck, and the other classes can see that menu item's check mark status. I received a suggestion of creating a class for the menu option (with a popup option), however, I can't create a class for the menu option when I'm in the resource layout ed...
Hi,
I encountered strange behaviour of my application. I would like to close frame window in MDI application, so I send WM_SYSCOMMAND (SC_CLOSE) to that window. After that, I receive OnSysCommand. Then I call CMDIChildWnd::OnSysCommand to proceed processing.
The problem is, that sometimes base implementation of OnSysCommand calls OnCl...
Hi guys,
I'm looking to use the "Microsoft Web Browser" ActiveX control in an MFC app, but we need it to be IE6 in order to support legacy stuff and all that not-so-fun stuff. The systems that it will be deployed upon, however, may have IE7 or IE8 installed.
I'm not much of a COM/ActiveX guy, although I know my way around C++ and MFC. ...
Hi all,
We have a relatively large MFC application that uses an SDI to host a number of dynamically created CView- based views. The basic structure of the application is somewhat like Outlook (tree view on the left, dynamic view(s) on the right).
I've been puzzling over the correct way to handle focus changing in the app. For example...
I am using the following code to create a compatible DC:
m_pDC=new CDC();
VERIFY(m_pDC->CreateCompatibleDC(sampleDC);
CBitmap bitmap;
if (bitmap.CreateCompatibleBitmap(sampleDC, rect.Width(), rect.Height()))
{
m_pOldBitmap = m_pDC->SelectObject(&bitmap);
}
My question is does CDC CBitmap occupied memory ?
If it is using memory, wh...
How do you develop UI in MFC?
do you use any free libray, or usually develop from scratch?
There are always so many DLL files in a C++ developed software, what are them used for ?
What's the difference between MFC ActiveX Control and MFC DLL ?
...
I have installed in my PC VS2008 and Windows Mobile 6 SDK.
I have made a SmartDevice MFC application and a Regular DLL MFC, both uses shared MFC DLL.
But when I called DoModal() of the DLL the application hangs, show a "Debug Assertion Failed" message and freeze my device.
Can you help me?
Codes:
The EXE code:
typedef BOOL (CALLBA...