mfc

MFC Application in VC++

I have developed a desktop application using MFC, which has FILE, EDIT, VIEW and HELP options,along with one pen to write on the opened document which saves as test1. It is allowing me to open only test1 or test2 etc. Apart from these types of files, if i want to open PPTs or PDFs how can i do it? The code to open a file is autogenera...

When an MFC dialog is hidden after DoModal, are its controls destroyed?

I've used MFC dialogs before where you do: EnterNameDlg dlg; dlg.DoModal(); string str = dlg.GetName(); However a dialog I have now actually looks at a list-box control in such a method and it's not working. Although the class instance clearly exists after DoModal(), does the actual dialog get destroyed? I noticed calling DoModal() a ...

How do I get the paintable area in a CFrameWnd with dialog bars?

I have a CFrameWnd with a dialog bar, and I'd like to determine the paintable area (excluding the space used by the dialog bar) so I can draw in it without being overlapped by the dialog bar. How can I do this? GetClientRect() seems to cover the client rect area as well, and I don't see any other obvious candiates in the doucumentation. ...

copy a whole application to new application visual C++ MFC/Smart Device?

Hi, I am using Visual studio 2005 for my development. I am doing a smart device application using Visual C++ MFC. I had an application runnning perfectly on a device with ARMV4, till recently we receive a new Device with ARMV4I. the application is running on the new device but some features are not working, mainly serial port communi...

How is MFC app commiting to virtual memory?

I am working on an MFC app that seems to be automagically committing to ~160MB of virtual memory. The app typically runs at 10-14MB of memory usage so this level of committed memory seems excessive. Additionally there is no where in the code where VirtualAlloc is called... COM & ATL are also being used. The memory shows as committed t...

module machine type 'THUMB' conflicts with target machine type 'ARM'

Hi, I had a windows mobile application running for ARMV4 (Pocket PC 2003) We got a new device XXXCE6 (ARMV4I), we need to compile the application for it, we followed these steps: install the Device SDK Build-> configurartion manager choose NEW from active solution platform for New Solutin platform we have chosen XXXCE6 (ARMV4I) , an...

Can OOPP (Out-of-process plugin) windowless?

Hi, I am trying to write a OOPP(Out-Of-Process plugin) ActiveX in vs2008. can an OOPP activevx plugin windowless? if so with out windowhandle how can we send signals to that window? ...

"Member not found" error when using vlc plugin in vs2008 Mfc

Hi i am trying to use vlc plugin in my vs2008 mfc project to play video files. but i am getting "Member not found" exception. can any body suggest me how to overcome this? ...

Who's using MFC's VERIFY Macro?

To think ... there I have been happily programming in an MFC riddled environment for years, using ASSERT() whenever it seemed OK and just today I (was) stumbled upon the VERIFY Macro: http://msdn.microsoft.com/en-us/library/fcatwy09%28v=VS.71%29.aspx It's basically the same as ASSERT() except the expression will not be removed in releas...

Is there any better MFC 2008 Feature Pack Documentation

I'm trying to figure out how to use the CDockablePane. But the just a few total overloaded demo samples (look like marketing samples not intended for programmers) i can't find any Tutorial kind. And the reference is heavy for a medium skilled MFC hacker like me. EDIT: This is the only documentation i have at the moment: MSDN VS2010 M...

VC++ and MFC Applications.

Can anyone suggest the links for implementing the CUT Option as in the case of MS PAINT for selecting the particular portion of the image drawn and pasting the same.....! ...

Windows 7 not firing WM_SETFOCUS when switching nodes within a tree control

My application has a tree of type CTreeCtrl. One of the nodes of the tree is CComboBox control created as a child of this tree structure. c_combo->Create( WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_HASSTRINGS | CBS_DROPDOWNLIST, myrect, m_pTree, IDD_OBTC_COMBO ); In essence, the ComboBox gets created when clicked on the tree node and we...

CStdIoFile::ReadString reverts to previous position?

So, I've got a class that looks sort of like this: class A { CStdioFile FIN; CString Line; void DoStuff(); void DoOtherStuff(); }; A::DoStuff() { //assume FIN has already been opened while(FIN.ReadString(Line)) //<----Weirdness happens here after first iteration { //do some stuff ... ...

Getting error message from CStdioFile::Open()?

If CStdioFile::Open fails, I want to be able to report the cause of the error. However, it appears as though it never throws an exception. Also, when I try the following: CStdioFile file; CFileException exc; bool bSuccess = (file.Open(_T("FileDNE"), _O_RDONLY, &exc) == TRUE); ASSERT_FALSE(bSuccess); CString err; exc.GetErrorMessage(e...

change icon for TBBUTTONINFO

How to change icon for TBBUTTONINFO to my own icon? TBBUTTONINFO inf; inf.cbSize=sizeof(inf); inf.dwMask = TBIF_IMAGE; inf.iImage = 1; // <---- currently this number points to IE's icons. SendMessage(m_hWndToolbar, TB_SETBUTTONINFO, m_buttonID, (LPARAM)(&inf)); Help me :( ...

changing GLUT calls to work with MFC/C++

I have a program that uses GLUT for its OpenGL rendering. Now I need it to be inside of a MFC project so that it can work with another program component. I've followed this tutorial: 1/Setting-Up-OpenGL-in-an-MFC-Control.htm">http://www.codeguru.com/cpp/g-m/opengl/openfaq/article.php/c10975_1/Setting-Up-OpenGL-in-an-MFC-Control.htm I ...

Runtime error upon ON_WM_LBUTTONDOWN in a CTreeCtrl control

My application consists of a custom tree derived off of MFC CTreeCtrl. I handled the ON_WM_LBUTTONDBLCLK such that when I double click on a particular tree item, it changes to a combobox and ON_CBN_KILLFOCUS will destroy the combobox and reset the tree item. Double clicking the tree item creates a combobox but left clicking an item afte...

how to close specific serial port in C++ MFC smart device application?

how to close specific serial port in C++ MFC smart device application? how to check if a port is open? and how to close it? i am using this " ex: http://msdn.microsoft.com/en-us/library/ms881795.aspx ...

ERROR_DEV_NOT_EXIST when ::CreateFile in C++ MFC?

Hi, I am writing to open a port using this function: HANDLE hFile = ::CreateFile(pszComName, GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0,0); // Check if we could open the device if (hFile == INVALID_HANDLE_VALUE) { DWORD hh= ::GetLastError(); error.Format(_T("test - [%d]"),hh); AfxMessageBox(error,MB...

How to load a string from the resource of a different process?

I need to load a string which is placed in the resource dll of a different process, provided that the process will be running at the time of call. I tried following code - HMODULE hRes = ::LoadLibrary(_T("SomeResource.dll")); TCHAR buffer[50]; ::LoadString(hRes, IDS_SOME_ID, buffer, 50); This code is working fine while r...