mfc

How can I get file extension description through CFileDialog

CFileDialog fileDialog( FALSE, // We are save as file dialog. _T("*.txt"), // Default save as text format. _T("hello"), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, _T("Text Files (*.*)|*.txt|Excel Files (*.xls)|*.xls|Excel Details Files|(*.xls)||"), this); // Returns me ...

Migrating MFC (VC6) application to .NET 2008

I want very specific answer from the developers who did this and want to know how you resolved the problems you faced. We have very big MFC (VC6) 32 bit application existing for 10 years. Now we would like to migrate it to .NET unmanaged 64-bit application. Here we have some problems, our UI should not change, we may need some managed ...

Drawing a jpg in MFC

Hi, I've been trying to show a jpg image in MFC, but I can't get it drawn. I'm a complete MFC newbie an everything I got up until now is mostly adapted from things I found on the net. Currently I have this: Picture.h: #pragma once #include <afxwin.h> class Picture { public: Picture(); bool load(LPCTSTR filePath); bool draw...

MFC Ribbon - get base element clicked from command

I have a CMFCRibbonUndoButton on the ribbon of an MFC application. I have a handler for when its ID is clicked (ON_COMMAND(ID_EDIT_UNDO, ...)). However, when the button is also in the quick access toolbar (QAT), there are apparently two CMFCRubbonUndoButtons which each keep their own state. In the command handler, I don't know how to ...

How do I get a string or stream into a CStreamFile?

Hi, this question may seem a bit too specific, but I figure I'd give it a shot here since I've found some great programming answers here in the past. I am modifying the open-source program TinyCad for a project I'm working on. I've visited the TinyCad message board and posted, but I didn't get the answer I'm looking for. I'm having trou...

How to write a scrollable MFC custom control ?

I want to write my own chart control which requires scrolling. I found that there is a CScrollView but nothing like this for a control. Other toolkits like Cocoa, QT or GTK offer me a base class where i can set a content view which is displayed in a viewport and saves me from writting all of the scrolling code. ...

VC++ and MFC Applications.

Is there any way to integrate the codes written in CRichEditView and CScrollView in VC++, to run as a single application..... ...

Is there a way to send a CString to a CFile without writing an actual file?

I have data stored in a CString and it needs to be parsed by an XML parser library. The problem is the XML parser takes in a CFile. It's not ideal to write out the CString to a text file and then reload it into a CFile. Is there any way to directly send the CString to the CFile without making an intermediate output file? ...

Shared memory without memory-mapped files.

Is it possible to share memory between two MFC C++ applications without using Memory mapped files? Currently we are using this method to share structs, and it is too slow for our requirements. Is there a better way? ...

How to fix error with sample code for MFC tooltips?

I get this error when compiling the following source from here: Error 1 error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)' e:\development\tooltips\cqa0311\statlink.cpp 28 The line of code is for the ON_WM_NCHITTEST below BEGIN_MESS...

MFC and Scripting?

I have an MFC application. What scripting library can I use to give users to access my application via scripting? Can I do something like: Use JavaScript + MFC and build a front-end using JavaScript and mini-HTML viewer in a single EXE? Maybe this question should be: I like server-side JavaScript and MFC/C++. Can I compile an embedde...

How to capture WM_KEYDOWN event when PRESS TAB in MFC.

I want to capture WM_KEYDOWN event when PRESS TAB, but looks like I cannot do it. Only WM_KEYUP can be caught when press TAB ...

Creating the MFC print preview dialog bar and showing it in a CFrameWndEx

For various reasons, I have to reimplement MFC's print preview functionality. I'd like to re-use its styled print preview dialog bar in a CFrameWndEx, but I've been running into problems. First, if I use something like the following in a CFrameWnd, I can successfully embed the toolbar: if (!m_wndDlgBar.Create(this, ATL_MAKEINTRESOURCE(...

NTier with MFC... ?

I am writing a Visual C++ MFC application and getting stumped over what seems to be simple issue. There is a server and database (MSSQL) Open ports are HTTP, HTTPS There is the MFC client. It needs to connect a TCP/IP stream (possibly HTTP, SOAP, REST) to the server. Sometimes the MFC client goes off-line and then the MFC client store...

OpenGL equivalent of SetROP2(R2_NOT)

Considering QGLWidget (or OpenGL in general), what can be the easiest solution to draw pixels in the inverse color of the screen / frame buffer? In Win32 / MFC environment, I used to use the SetROP2(R2_NOT) with zero pain. ...

error RC2176 : old DIB in res\icon3.ico; pass it through SDKPAINT??

Hi, what is this Error, and how to resolve it? I am using Visual studio 2005 for Smart device MFC developement, Is upgrading to 2008 can solve my problem. Error 85 error RC2176 : old DIB in res\icon3.ico; pass it through SDKPAINT Thanks ...

error RC2175 : resource file res\icon3.bmp is not in 3.00 format??

HI, what does this mean, and how to resolve it? error RC2175 : resource file res\icon3.bmp is not in 3.00 format ...

what is the mazimum icon' size can be used in c++ mfc dev?

what is the mazimum icon' size can be used in c++ mfc dev? ...

how can i cancel editing in CListCtrl by hitting the "cancel" key?

I'm editing an item in CListCtrl control. an edit box appears where I can enter text. The event of entering the text will, however, not be catched by the LVN_KEYDOWN handler. how do I catch it otherwise? any samples? Thank you ...

Is MFC supports winsock2?

Hi all, I'm a fresher to Visual Studio. I read some where MFC supports only winsock1. Is it true that MFC doesnt support winsock2? ...