mfc

Difference between a C++ exception and Structured Exception

Can someone explain the difference between a C++ exception and a structured exception in MFC? ...

How to add a Dialog Box Launcher on a Ribbon Panel

I am programming an application with Ribbon Control instead of Menu and Tool Bar. Office 2007 is an example of Ribbon and we can see a small button called "Dialog Box Launcher" on right side of a Ribbon Panel Caption. But I can't find how to add a Dialog Box Launcher on a Ribbon Panel. I am using Visual Studio 2010 Professional C++. Plea...

How to check if an other program is running in fullscreen mode, eg. a media player..

Hi, How can I check if an other app is running in full screen mode & topmost in c++ MFC? I just want to disable all of my auto dialogs (warnings) if media player or other players are running. (Like silent/gamer mode in Avast.) How could I do that? Thank you. ...

Datatype misalignment exception(0xA0000002) on ARM processor

My application runs well on HTC HD2 which has Qualcomm 1GHz Snapdragon processor but when try to run on Windows professional emulator 6 or PIDION which has ARM processor, it crashes with datatype misalignment exception. Can anyone please help me out to find why it crashes and how to resolve it. According to this link, __unaligned shou...

Trying to extract an MDI child window outside its MDI parent

I have been able to reparent an mdichild window to the desktop with the following code: SetParent(hSeekedWindow,0); SetWindowLong(hSeekedWindow,GWL_STYLE,WS_OVERLAPPED|WS_VISIBLE|WS_CAPTION|WS_MAXIMIZEBOX| WS_MINIMIZEBOX|WS_THICKFRAME|WS_SIZEBOX); SetWindowLong(hSeekedWindow,GWL_EXSTYLE,WS_EX_CLIENTEDGE); However, as soon as i try ...

example of using StingRay SECSplitterBase

I am interested in a code fragment that demonstrates how to use the Layout Factory and SECSplitter Base (both from StingRay) to deliver a splitter window inside another splitter window. ...

Cold startup optimization

I tried to search, but so far with no luck. Does anyone know a good resource how one should do cold start optimizations? The app in question is C++/MFC app, compiled with VS2010, full version, with built in profiler available. I have tried to cut down all the extra weight to get the load times acceptable for warm start, but the cold sta...

MFC data forwarding to main thread via PostMessage

I have a C++/MFC application I need to restructure. The app used to process most of the data on the main thread, therefore blocking the input, and now I want to change it so, that all GUI updates are done through PostMessage. Unfortunately, I can't seem to find a good source on how to achieve this goal. Right now I'm thinking of creati...

Get mouse clicked component

Current, I have a parent CWnd, which is displaying many other child CWnds. All my message handling job are being done in parent CWnd, as I do not have access to child CWnds' code. I wish to know which child CWnds is being clicked. I can detect the right click afx_msg void OnContextMenu( CWnd* pWnd, CPoint pos ); pWnd will be...

how to get drives letters which are available (not in use) in MFC ?

hi, how to get drives letters which are available (not in use) in MFC using C++ ? Any code snippet.. ...

Setting tab order of item on the dialog

Hi, I am facing a problem in setting the tab order in a dialog box. To set the tab order I have used the function SetWindowPos(). Initially it will be focused to one of the dialog item, but if I press tab it will not change the focus to the other items on the dialog box. Please help he to fix the problem. bellow is the code... HWND...

combobox like IE8 address bar - how to?

hi, i would like to write in MFC combobox that behave like the combo in the IE8 address bar. with the option of auto complete (which it is a property on the combo - right?) and the delete option on the right (is the drop down is a list control?) ...

How to pass structure from C# to ActiveX function created in C++ (MFC)

Hi everyone, I've strange problem: the MFC structure is #define SENSOR_DESC_LEN 30 #define CAM_ID_LEN 20 typedef struct { unsigned int SensorType; char Desc[SENSOR_DESC_LEN]; unsigned int CommType; // USB or TCP - COMM_TYPE float FirmwareVersion; float HardwareVersion; int Width; int ...

Discard ALT key press in CMainFrame

I'm having the following code: CMainFrame* pFrame = new CMainFrame; if (!pFrame) return FALSE; m_pMainWnd = pFrame; // create and load the frame with its resources pFrame->LoadFrame(IDR_APP_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL); // The one and only window has been initialized, so show and update it pFr...

class wizard from dialog box in VC ++ 9.0

does any body know how to bring a class wizzard from a dialog box in MFC application using VC++ 9.0 only. ...

Linking to a Library requires MFC80U.LIB

I am trying to compile the SkpWriter example from the latest SketchUp C++ SDK. However, the linker gives me LNK1104 saying that "mfc80u.lib" could not be found since one of the static libraries (Utils.lib) in the SDK depends on some MFC 8 libraries. I am using VS2008 and only mfc90u.lib is available. Is there a way to use mfc90u.lib in ...

How to show a window before processing in MFC

How can I get a window visible before processing? I'm trying to do something like this: void CMyClass::OnButton1Clicked() { CString class_str = AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW, ::LoadCursor(NULL,IDC_ARROW),(HBRUSH)::GetStockObject(WHITE_BRUSH),::LoadIcon(NULL, IDI_APPLICATION)); CWnd* wnd = new CWnd(); wnd->Create(class_...

DrawText(), DT_LEFT and colons moving to beginning of text???

Hi, on some PCs I am finding that my calls to DrawText() result in colons being placed at the start of the text. dc.DrawText( "Name:", &rText, DT_LEFT | DT_VCENTER | DT_WORDBREAK ); The output on my PC is Name: But on one PC in particular it is: :Name If I change DT_LEFT to DT_CENTER the colon appears at the end where it should...

Problem with loading JPEG file from resources in MFC C++ application

The following code works correctly under Windows XP: CImage image; RECT destRect; int nResource = 10; CResourceStream stream(0, MAKEINTRESOURCE(nResource), _T("JPEG")); HRESULT hr = image.Load(&stream); image.Draw(hDC, destRect); But on Windows 7 image.Load returns E_FAIL though creating CResourceStream reads JPEG file from resou...

Example needed of how to use the ADW (from StingRay) to nest docking windows

I would like to see an example of how to use the ADW (from StingRay) to nest docking windows. The documentation says you can do it, but does not provide an example! Thank you for your assistance in this matter. ...