mfc

Removing external dependencies to MFC DLL project

Im developing a MFC DLL project in VS2008. The dll compiles OK and I can call it fine from an GUI exe that a contractor has developed for me. Visual C++ Redistributables are required to be installed for my dll (and maybe the exe which is developed in C++ too) Another company wants to licence my dll to use with their C++ exe. They have ...

About downcasting from base class to subclass pointer...

A static check tool shows a violation on the below code: class CSplitFrame : public CFrameWnd ... class CVsApp : public CWinApp CWnd* CVsApp::GetSheetView(LPCSTR WindowText) { CWnd* pWnd = reinterpret_cast<CSplitFrame*>(m_pMainWnd)->m_OutputBar.GetChildWnd(WindowText); return pWnd; } ERROR MSG: Clas...

Placing Tab Control at runtime issue in MFC

Hi, I am loading background image at runtime in my MFC Application. Like this : m_objMainScrnDC.CreateCompatibleDC(NULL); m_objMainScrnBgBitmap.LoadBitmap(IDB_MAIN_SCRN_BG); And i have tabcontrol on my page at design time , now i want to place a background image for tab control at runtime but i am not able to get that image...

How to get correct hDevMode values from CPrintDialogEx (PrintDlgEx)?

I'm displaying a CPrintDialogEx dialog to choose a printer and modify the settings. I set the hDevNames member so that a default printer will be selected, but I leave hDevMode set to NULL. On successful return I pull some values such as paper size out of the returned DEVMODE structure from hDevMode. I'm having a problem because hDevMode...

Lose classes in VS C++ 6.0 when backing up project

I have a project that contains 235+ source and header files. In my standard development cycle, I develop a little, test that development, create a release version, test that and deliver that release to my customer. I then copy the project directory and change its name. I then start all over again to address new customer requirements. ...

Example needed for ADW using nested frames in StingRay

I have modified the AdvSDI example (included in the StingRay distribution disk) and have removed all but two dockable nodes that represent floatable areas of information. One is initially docked against the top border, the second is docked against the left border. I wish to add two more dockable nodes. When I do so they displace the i...

Custom CListCtrl

Hi! I need to create a ListControl in MFC, each row having different number of columns. How can I do this? Thanks Tarun ...

How to display selected file name in VisualC

Hi, I created a small MFC application which has a brose button and then a dialog box. on the button event, I am able to successfully open the select file option, but when I select the file, it doesn't get displayed in the Dialog box. How can I do that? Please help... ...

ondraw function is not calling in mfc?

i have a dialog in which i made list control and made its ownerdraw true.but on draw funtion of dialog is not calling for list.what would be the reason ...

Compile MFC Code From C# Windows Application

I'm building a C# Windows App to compile & Build MFC Code i googled a-lot and I found this thread very useful Thread but i'm facing 2 problems; 1) Related To Compile as my MFC project have 4 different configuration 2 for Oracle 10 & 2 for Orace 8i but when i pass Oracle 10 Configuration in command-line it doesn't recognize it & builds t...

Visual Studio 2010 new project wizard manufactured MFC Dialog program doesn't compile in Debug Mode?

I've created a new project using the Visual Studio 2010's wizard. Once VS was finished generating the project I tried building it - in release mode it worked great, but in debug mode it didn't, giving the following compiler error: 1>------ Build started: Project: MyProj, Configuration: Debug Win32 ------ 1>Build started 05/10/2010 22:17...

Error in try catch while converting VC6 to VS2008

When I opened a VC6 project in VS2008 and tried building it , initially I got the error: fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory error C2259: 'CException' : cannot instantiate abstract class error BK1506 : cannot open file '.\Debug\SClientDlg.sbr': No such file or directory ...

Remove selection from initialized text (Deselect) in CEdit control

I have CEdit control and I don't want any text to be selected by default. I tried using m_txtURL.SetSel(-1, 0, TRUE); to remove the selection, but to no avail. can some one suggest a way to do achieve that? I tried to select some characters using the following coding. That too did not work. m_txtURL.SetSel(-1, 0, TRUE); Can s...

Migrating ActiveX Component from VC++6 to VC++2008 giving errors in cstdio and xiosbase

I am trying to port VC++6 code which builds an ActiveX component to VC++2008. Whenever I use "#include", it is giving me errors which point to cstdio and xiosbase. I dont understand the reason for it, Can someone let me know why this is happening? Error trace: c:\Program Files\Microsoft Visual Studio 9.0\VC\include\cstdio(34) : error C...

Is it possible to add a CMFCRibbonEdit to a CMFCToolBar

Can a CMFCRibbonEdit control be added to a CMFCToolBar using the 2008 feature pack? Ray ...

Debug symbols not found for static lib in Visual C++ 2008

Hello, I'm trying to debug a static library using MFC in Visual Studio 2008. When running the project in debug mode the breakpoints turn into circles and hovering over them produces the message "The breakpoint will not currently be hit. No symbols have been loaded for this document" The project configuration is set to "Debug", and...

Resource conflict on ON_UPDATE_COMMAND_UI

I have an EXE class which contains a button resource with ID EXE_BUTTON_RESOURCE ON_UPDATE_COMMAND_UI(EXE_BUTTON_RESOURCE, OnUpdateExeButtonResource) void EXE::OnUpdateExeButtonResource(CCmdUI* pCmdUI) { pCmdUI->Enable(exe_flag); } This EXE application will load another DLL class. DLL class is having a menu item resource wi...

Is my design for UDP socket server correct?

I am designing a server which is used in UDP communication using MFC. I have the following classes CMyDlialog - Take care of User interface CController - Act as an Mediator between all the classes CProtocolManager - Take care of Encoding/Decoding msgs (This is a static class) CConnectionManager - Take care of UDP connection, Sending, R...

DDV_MinMaxUInt : Custom Validation Message

I am using MFC, to develop a Mobile App. For one of the CEdit controls, in the dialog box, I declared a variable as long int as follows. DDV_MinMaxUInt(pDX, m_txtCurrentValue, 1, 2000); So whenever, I try to close the dialog box with invalid values (integers that is not in the range specified or which are alphabetic characters.) it th...

ON_EN_KILLFOCUS called multiple times

I am using a CEdit control. And I have assigned an event handler for ON_EN_KILLFOCUS message. It gets called correctly. But the problem is that, when ever, I close the dialog box, this event handler gets called four times. How can I prevent this? ...