mfc

Pros and Cons of the available Visual Studio 2008 c++ project platforms?

If choosing between: ATL Windows Forms MFC Win32 Specifically the application will be: for completely in-house use. Most users lack basic windows/pc knowledge. (consider simple UI) used for automated testing which entails:-bringing in lots of data from external equipment (can choose VXI, USB, or Ethernet)-very heavy on graphics - l...

How to send files b/w two machines through socket programming?

Hi, I have requirement to send all the files in the directory to a different machines, the directory may internally contain child directories. Is there any help available on this? One more doubt is: I also heard that we can send the files using FTP, if so which is the best between the two. Is there any help available for this? I nee...

MFC CDialog::Create fails

I'm having problems with some code to create a CDialog based window. The code was working fine last week. The only changes I made was replacing a C++ deque with a hash array. I had commented out the line of code with the Create method being called to allow me to skip loading the window. Now the code doesn't create the window at all a...

What are some techniques for migrating a large MFC application to WPF/.NET?

I am currently working on a very large legacy MFC MDI application. It has a large number of UI elements - dockable toolbars, custom tree controls, context menus, etc. It is an image processing application so the main views render themselves using DirectX and OpenGL. The product is about 10 years old and one of the priorities here is t...

CListControl selection (MFC)

Hi, In report view in a CListCtrl in MFC, how do I detect if there is no current highlighted selection? Using GetFirstSelectedItemPosition doesn't work because if an item was previously selected and then clicked somewhere else on the list control, GetFirstSelectedItemPosition still reports the last position selected instead of NULL, h...

With CDatabase, can I send SQL without using CRecordSet?

When using the MFC class CDatabase to connect to a data source, is there any way to execute SQL statements without having to open a CRecordSet object? I ask because CRecordSet::Open() appears to throw an exception when I use it to call stored procedures that don't return anything - and there's no reason to expect results from, say, sp_d...

Pixel manipulation in Bitmap image using MFC

hi i created a dialogbox using MFC dialog.. using below url i displayed a bitmap picture in a dialog box. http://www.functionx.com/visualc/applications/displaybitmap.htm i have not write any code for that.i just added the bitmap Picture into import picture dialog box and used picture control and followed the tutorial... when i run my ...

SQLite with MFC

Hello, I want to use SQLite within my MFC application. for that, i'll create an object whose job is to interact directly with the DB(SQLite) to insulate the rest of the app from the DB code. can anyone point me to a good tutorial ? i'll need operations such as (create,delete,insert,update,createdb,dropdb and so on...) Thanks. ...

iPod interaction

say I want to write a windows application in which i want to transfer some files to my connected iPod device or any other MP3 player. how can i accomplish that ? ...

Which one to use c++ stl container or the MFC container?

For every stl container there is a MFC container available in visual c++.Which is better than the other one in what sense and what do you use? I always use STL container is that wrong? ...

How to remove the close button from an MFC caption bar

Is there an easy way to remove the close button from an MFC feature pack caption bar? (I don't mean the window caption, I'm talking about the little information bar that can appear at the top of the client area in these apps - ie:CMFCCaptionBar) Thanks ...

How to paint transparent areas for child controls?

I have a CTabCtrl subclass which I'm trying overriding WM_PAINT to perform custom drawing. The only problem is, when I change the selected tab, I get artifacts left on the dialog where the old paint code hasn't been erased before the new code is painted on top. (The standard tab controls have the selected tab appear 2 pixels bigger than ...

CMap with string as key and structure as value

hi, My requirement is given a string as key to the map i should be able to retrive a structure. Can any one please post a sample code for this. Ex: struct { int a; int b; int c; }struct_sample; string1 -> strcut_sample ...

Single Document project structure

I have previously asked about the proper way of accessing member variables present in the project. In the project, I have CWinapp-derived class, CMainFrm class, a list of different view classes. However, currently, I have instances of different user-defined classes instantiated in the CWinApp-derived class, while the rest of the classes ...

How to exclude MFC bar from dock state

Is there an easy way to exclude a control bar from the dock state saved by an MFC frame window? We have a dock bar whose visibility is controlled by some other state and the loading of dock state is interfering with the desired behavior. ...

How to handle messages from dynamically created controls in an MFC app?

Imagine I have a CDialog which creates controls dynamically when the user clicks a button. It could be like this: // We don't know which is the first id for the new buttons until runtime (!) MyDialog::MyDialog(/*whatever parameters needed*/, first_id) : next_id_(first_id) { /*...*/ } BOOL MyDialog::OnSomeButtonClicked() { CButton*...

Configuring new document in MFC

When the user creates a new document in my SDI-application, I need to present a dialog specifying details on the document to be created (think: resolution, bit-depth, etc.) I initially put the code for displaying this dialog in OnNewDocument() (I don't need it when opening an existing document), but putting user-interface code in the doc...

convert CString to const char*

How do I convert a CString to const char* in my Unicode MFC application? ...

validating CEdit without subclassing

Is there any way to validate the contents of a CEdit box without subclassing? I want to check for invalid filename characters in a CEdit box and not allow the user to input it at all (keypress should not be recorded, if pasted in the box, the invalid characters should just not make it to the edit box).. Is there any easy way to do this...

How to place a .net UserControl on a c++ cdialog in visual studio 6

Hi My task is pretty simple create a .net usercontrol and use it in a old visual studio 6 proejct. I have createt the usercontrol (its just a user control with a label), I then followed this guide (http://support.microsoft.com/kb/828736) and it seems to work fine. But how can I display the usercontrol? Do I have to use CreateControl, a...