mfc

dynamic creation of buttons in a group

hi i want to create a 12 buttons dynamically, 6 button 40x40 pixels and 6 button size 60x60 pixels with two different groups (group 1 contains 6 buttons and group 2 contains 6 buttons) with border.and i want to move groups within the dialog eg : MFC dialog window contains many controls and we can easily move the dialog within the s...

Problem in Communication between two dialog boxes through WM_COPYDATA?

Hello all, Friends its really giving me a great head ache about the problem I am facing for the couple of days...Its simple...I want to communicate between two/more dialog boxes for example if there is a variable CString test..I want this test variable to be common for the dialogs/classes(considering each dialog having separate cl...

Not able to Show a Dialog Box in its class using SW_SHOW in MFC?

Hello all, I am trying to create a wizard like structure using dialog boxes...So I replaced the code in CDialog1App as below CDialog1Dlg* dlg = new CDialog1Dlg; m_pMainWnd = dlg; dlg->Create(IDD_DIALOG1); dlg->ShowWindow(SW_SHOW); the above worked fine...its displying the dialog box.but I have added another dialog box... So ...

MFC MDI CView and some kind of bar at bottom of CView

Hi, I have created a MDI project with CView's using VS2008Pro. I want to have some sort of bar at the bottom of every CView where i can put controls on, like buttons. I dont know how this bar is called and how to create one for every CView. I have a picture of it here to explain what i want. http://www.4shared.com/dir/32975742/b4...

How to create toolbar in CMDIChildWndEx derived CChildFrame ?

Hello, This question is a follow up of my previous question. First thanks for the links and examples, they do work voor a CMDIChildWnd derived CChildFrame class, but not for a CMDIChildWndEx derived one. What i want to do: I want to create a toolbar in the CChildFrame window (derived from CMDIChildWndEx !!) What i have done so far: ...

How to Get File security attribute in windows

I am using c++ MFC How can I get the file security attribute in windows, is there any handy api? Many thanks! ...

How to add an existing VC6 project in to a workspace from add-in or VBS macro.

I want to add an existing VC6 project in to a workspace from add-in or VBS macro. There is no function to insert an existing project in Developer Studio's Application object. So I tried to add a new project (with the same name of existing project) using Application's AddProject method and then overwrite the project file created with my e...

MFC : How to add tooltip in Cmenu items?

How do you add tooltips for CMenu Items? I couldn't find any straightforward and helpful resource. Please help. Thanks... ...

Conversion from string to wstring is causing ú to lose encoding

The variable filepath which is a string contains the value Música. I have the following code: wstring fp(filepath.length(), L' '); copy(filepath.begin(), filepath.end(), fp.begin()); fp then contains the value M?sica. How do I convert filepath to fp without losing the encoding for the ú character? ...

Is it possible to edit data in place using CListCtrl - if not, can anyone suggest an alternative control in MFC?

I'm designing a MFC app in which I'd like to have a grid with 2 coloumns : both editable in which the user will input data and the app will get notified about it. The number of rows can be increased/decreased by the user as he wants - What would be the ideal MFC control to use for this kind of requirement ? This is my first time designi...

Dockable panes created in CChildFrame not visible the second time the app. starts.

Hi, I have created some dockable panes in CChildFrame::OnCreate() The first time i start the application they are shown. The second time i start the application they are created but the splitterwindows are completly against the sides of the clients area (bottom and right), so not visible. So i have to use the mouse to pull the splitters...

MFC (C++) CDialog DoModal() not working as expected

Hi, I have a plugin that is loaded by this application.. This plugin calls some dialog boxes with DoModal(). I'm expecting these dialog boxes to function like this: If I click on the application window behind the dialog box, the dialog box flashes and does not allow the application to be in focus. However, in one of the other dialog b...

How can I statically link my MFC extension DLL?

Hi. I have an MFC extension DLL that I've written. It contains derived classes of MFC controls (e.g. replacements for CButton etc) and also contains bitmap resources. I wanted to create a static library - mainly because I do not want the code seperated into a DLL. However, I found that even though it is possible to add resources to a st...

Get path to My Documents

From Visual C++, how do I get the path to the current user's My Documents folder? Edit: I have this: TCHAR my_documents[MAX_PATH]; HRESULT result = SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, my_documents); However, result is coming back with a value of E_INVALIDARG. Any thoughts as to why this might be? ...

MFC: How do I construct a good regular expression that validates URLs?

Hi All, Here's the regular expression I use, and I parse it using CAtlRegExp of MFC : (((h|H?)(t|T?)(t|T?)(p|P?)(s|S?))\://)?([a-zA-Z0-9]+[\.]+[a-zA-Z0-9]+[\.]+[a-zA-Z0-9]) It works fine except with one flaw. When URL is preceded by characters, it still accepts it as a URL. ex inputs: this is a link www.google.com (where I can j...

MFC ActiveX keystrokes Problem

i have created an mfc activex control and want to handle the keystrokes. to handle keystrokes in child dialog. i override the pretranslate message in my child dialog class.to use pretranslate funtion in an activex control i have added hook . as solution for the similar problem described at http://support.microsoft.com/kb/194294. Now pr...

CDockablePane window in CChildFrame disappears when dragged with mouse

Hi, I have created dockable panes in my CChildFrame class in OnCreate() : int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIChildWndEx::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here /* m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_CHILDFRAME); ...

What is the Win compile switch to turn off #pragma deprecated warning?

Using Visual Studio .NET 2003 C++ and the wininet.dll Am seeing many C4995 warnings More info Any help is appreciated. Thanks. ...

How to prevent scroll-bars in CScrollView/CFormView-based class in MFC (Windows Mobile 6)

I'm creating a Windows Mobile 6 application using MFC Single Document Interface with CFormView base class. I put CBitmapButton in the Form/Dialog resource and put them at the bottom. The CBitmapButtons fit nicely until a soft-keyboard appear or the application is covered by other applications. In such case, unwanted scroll bars appear ...

Is qsort thread safe?

I have some old code that uses qsort to sort an MFC CArray of structures but am seeing the occasional crash that may be down to multiple threads calling qsort at the same time. The code I am using looks something like this: struct Foo { CString str; time_t t; Foo(LPCTSTR lpsz, time_t ti) : str(lpsz), t(ti) { } }; class Sort...