mfc

Programmatically updating FILEVERSION in a MFC app w/SVN revision number

How do I go about programmatically updating the FILEVERSION string in an MFC app? I have a build process that I use to generate a header file which contains the SVN rev for a given release. I'm using SvnRev from http://www.compuphase.com/svnrev.htm to update a header file which I use to set the caption bar of my MFC app. Now I want to us...

Getting user name/password of the logged in user in Windows

Hello all, Is there any API to get the currently logged in user's name and password in Windows? Thank you in advance. ...

Is There Still A Case For MFC

What are the compelling features of MFC? Why would you select it for a new project? ...

Getting logged on user's name with or without domain in Windows

Hello all, Is there a direct API to get the currently logged in user's name with the domain? So, it would return something like "domain\user" when a machine is on the domain, but at the same time it would return "user" when the machine is not on the domain? If there's not, what's the best way to get this information? I noticed there's ...

Resizing Controls in MFC

Hi all, I am writing a program which has two panes (via CSplitter), however I am having problems figuring out out to resize the controls in each frame. For simplicity, can someone tell me how I would do it for a basic frame with a single CEdit control? Fairly sure it is to do with the CEdit::OnSize() funcion... but not really getting ...

MFC "Warning: skipping non-radio button in group."

When running an old MFC application in Visual Studio's debugger I've seen a lot of warnings in the Output window like the following: Warning: skipping non-radio button in group. I understand that in MFC you put radio buttons in groups to indicate which sets of radio buttons go together. If I remember correctly you do this by setti...

Starting service as a user with no password

Hello all, I'm trying to start a service as a user and things work fine, until I try a user that doesn't have a password. Then, it fails to start (due to log-on error). Am I doing something wrong or is this "by design"? The code to register this service: SC_HANDLE schService = CreateService( schSCManager, strNameNoSp...

Data visualization in desktop applications

I would like to create data visualizations in desktop apps, using frameworks, languages and libraries that help with this kind of task. Visualizations should be interactive: clickable, draggable, customizable, animated... What I would like to create is something similar to the examples seen here: http://www.visualcomplexity.com/vc/ Th...

Modifying/detecting Local Security Policy programmatically

Is it possible to do at least one of the following: 1) Detect a setting of a Local Security Policy (Accounts: Limit local account use of blank passwords to console logon only) 2) Modify that setting Using Win32/MFC? Thanks in advance. ...

Get CSIDL_LOCAL_APPDATA path for any user on Windows

Hello all, Is there any Win32/MFC API to get the CSIDL_LOCAL_APPDATA for any user that I want (not only the currently logged on one)? Let's say I have a list of users in the form "domain\user" and I want to get a list of their paths - is that possible? Thanks in advance! ...

i18n-able way to get number ordinal in C++/MFC on Windows? (1->1st, 2->2nd, etc.)

Is there an easy way to convert the number 1, 2, 3, ... to "1st", "2nd", "3rd", ..., and in such a way that I can give the function a language and have it return me the correct form for the language I'm targeting? Either standard C++ (stl or boost OK), MFC or ATL, win32 api or a small, single-purpose and free library that I can download ...

How to create a resizable CDialog in MFC?

I have to create a dialog based application, instead of old CFormView type of design. But CDialog produces fixed-size dialogs. How can I create dialog based applications with resizable dialogs? ...

How to create a very big bitmap in C++/MFC / GDI

I'd like to be able to create a large (say 20,000 x 20,000) pixel bitmap in a C++ MFC application, using a CDC derived class to write to the bitmap. I've tried using memory DCs as described in the MSDN docs, but these appear to be restricted to sizes compatible with the current display driver. I'm currently using a bitmap print driver ...

Get address of current page in Internet Explorer from toolbar

I'm trying to wrap my head around creating a toolbar (a tool band in a rebar) in MFC for Internet Explorer using COM. Is it possible to get the address of the currently viewed page (i.e., http://stackoverflow.com/questions/ask in my case :-) ) from the toolbar? If so, what should I look in to? Thanks! ...

Win32/MFC Get window rect from client rect

I know there is a function somewhere that will accept a client rect and it will convert it into a window rect for you. I just can't find / remember it! Does anyone know what it is? It will do something similar to: const CRect client(0, 0, 200, 200); const CRect window = ClientRectToWindowRect(client); SetWindowPos(...) ...

Visual Studio 2008 Express MFC Support

As may be known by many, the Express versions of Visual Studio 2008 don't include support for MFC and a few other packages required to compile a lot of windows programs. So, here's my problem: I have the full version of Visual Studio 2005. I've been using this to compile a project that a friend of mine was working on, so that I could ...

Why does my MFC app hang when I throw an exception?

If you throw an exception from inside an MFC dialog, the app hangs, even if you have a catch block in your code. It refuses to respond to the mouse or keyboard, and the only way to shut it down is to use Task Manager. Why I'm posting this question To my shame, there is a popular shrink-wrapped application that hangs every time it enc...

Windows C++ dialog resizer class

I'm looking for a really good dialog resizer class that will stretch and shrink individual items as needed as the screen is resized. Stephan Keil has a good one (DlgResizeHelper) which basically resizes everything by a set ratio, but I'm looking for something smarter. For example: Icons should not resize Single-line text boxes should...

CScrollView and window size

(MFC Question) What's the best way to determine the current displayed client area in a CScrollView? I only need the size of the visible portion, so GetClientRect() won't work here. ...

MS VC++ 6 class wizard

Ok, I'm developing an application that has been in pretty much continous development over the last 16 years, from C in DOS, through various flavours of C++ and now is largely based around C++ with MFC and StingRay GUIs and various other SDKs. While I use VS 2005 for the release builds, I still use MSVC 6 for much of the GUI building, si...