mfc

Performance issues using Copyfile() to copy files from different computers

Useing VC++ VisualStudio 2003. I'm trying to copy several image files (30kb or so per file) from another computer`s shared folder to a local file. The problem is that there can be more than 2000 or so files in one transfer, and it seems to take its toll, substantially taking more time to complete. Is there any alternate method of copy...

How can I create a guid in MFC

I need to be able to create guids on the fly. Is there a way to do that in MFC? I see how to do it in .net, but we haven't gone there yet. If not, do you have pointers to some code I can use? ...

.NET + COM changed keyboard routing behavior

Hi all! I have a problem so strange that I hardly can put an adequate title to it. In short: I have COM object written in MSVC++/MFC with a dialog derived from CDialog. On that dialog I have three child "user controls" - windows derived from plain CWnd. When I use this COM object from a variety of places, everyhing works as I expect. ...

Converting a large MFC app to .net

We have a decent size MFC MDI desktop app. Is there a reasonable way to convert a MFC app to a .net app or is it better to just rewrite? If the answer is app specific, what criteria do you use to make the decision? ...

Stick with MFC or go to .Net

We have a largish MFC app that is our main product. This app is being actively developed and there are no plans to stop development. I am new to windows development, but I get the impression that MFC is dead and all the new growth and enhancements are in .net. Is this view accurate? What criteria should we consider when deciding if w...

How to inherit a MFC dialog box?

Hi all, I have created a dialog box (cMyDialog). I am planning to duplicate cMyDialog and called it cMyDialog2. Can I know in MFC, how can I do inheritance? I want the cMyDialog2 to inherit all the IDDs from cMyDialog1 so that I do not have to copy and paste the codes from cMyDialog1 and cMyDialog2. The purpose of cMyDialog2 is to inhe...

CSTRING to char *

Hi All, We are using the CString class throughout most of our code. However sometimes we need to convert to a char *. at the moment we have been doing this using variable.GetBuffer(0) and this seems to work ( this mainly happens when passing the Csting into a function where the function requires a char *). The function accepts this and ...

Dynamic create/destroy CComboBox

I need to switch between the CBS_DROPDOWN and CBS_DROPDOWNLIST styles at runtime. It looks like the only way to do this is to re-create the control. So I have the following code: CRect rect; m_Combo.GetWindowRect(&rect); m_Combo.DestroyWindow(); m_Combo.Create(CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP | WS_VISIBLE, rect, this, IDC_MYCOM...

Making an MFC application international

I've got several large MFC applications here, and converting them into any other format is out of the question. We're expanding into other markets, and would like to make the apps work in other languages and cultures. So far, I've found occasional references as to what to do with Visual C++ version 6, with one mention that later versio...

Automatically display vertical scrollbar in multiline text edit control

On a windows mobile device I have a mutliline text edit control that is set to read-only and has some static text displayed during it's display lifetime. I would like to only display a vertical scrollbar when it's actually useful (i.e. the text is larger than the display). I can't easily figure out if the text is to large to display be...

(SHLWAPI.DLL): 0xC00000FD: Stack Overflow.

I have an SDI application Vc++6.0. I am running this application from an MDI application using ShellExecute function. When the SDI application runs it opens one ODBC dialog and if the user clicks on HELP butto, the application terminates. I checked using SPY++ and got the following reason for application termination (SHLWAPI.DLL): 0xC...

How do I convert from MFC's COleDateTime to C# DateTime?

Hi all, I have an older library that uses COleDateTime as a return type in a C++ MFC Dll. When I do a PInvoke, can I marshal that with confidence to a DateTime object? Or should I do something wacky, like convert the COleDateTime into the number of ticks since 1970, and then convert those ticks back to a DateTime object in the C# call...

Are things like "afx_msg" decorators still used by VS/MFC?

I'm working on an MFC program that started way back in the VC6 days. Back then there was a class wizard that used a bunch of decorators and markup in comments to parse class files. For example, it would insert afx_msg in front of message handlers that it maintained. It would mark a block of code with //{{AFX_MSG_MAP(TheApp) and /}}AFX_M...

How to debug a Word Add-in (.wll) in VS 2003

I am trying to attach to Word and set break points in the C++ (MFC) source code that I have just gotten access to. I have never done this before and hope that I have omitted some simple step. So far I have been able to: Compile the source code in VS (this produces .obj files and a .pdb file, but no .wll file which is confusing) Attach ...

How to copy CComboBox data to another CComboBox?

How to copy CComboBox data to another CComboBox? ...

Custom image while dragging an CWnd-derived object

Hi all, I want to display a custom image while dragging an object in a drag&drop operation. I have created a CWnd-derived control (a chart) and I display 4 of them in the same dialog. I've implemented drag&drop using COleDataSource so that the user can change its position by dragging and dropping the control. Now I would like to displ...

Is it possible to remove CMFCRibbonPanel from CMFCRibbonCategory?

Hi, i'm looking for a trick to remove an CMFCRibbonPanel from CMFCRibbonCategory. There is just AddPanel() function in the CMFCRibbonCategory, but no RemovePanel(). Do I really need to rebuild my whole CMFCRibbonCategory to do this? EDIT: Just for clarification, what i want is to remove panel itself from the category and not the elem...

How to kill a MFC Thread?

I spawn a thread using AfxBeginThread which is just an infinite while loop: UINT CMyClass::ThreadProc( LPVOID param ) { while (TRUE) { // do stuff } return 1; } How do I kill off this thread in my class destructor? I think something like UINT CMyClass::ThreadProc( LPVOID param ) { while (m_bKillThread) { // d...

User-Interface: Best way to toggle MDI frame's on-top status?

I maintain an MFC (VC6) MDI application that uses Frame Windows as views for a document. There is only one document at a time but there are several MDI-Frames each with a different view of the document data. Recently a request came up to be able to keep one of those frame windows on top of the others while being able to interact with th...

"Speech bubble" notifications

I'm trying to get a notification to pop up something like these bubbles in an MFC application: I'm currently making an interface mockup in C# to show some stakeholders, so it would be nice to have it there too. It doesn't necessarily have to be speech-bubble-esque: it could be something like a tooltip - but it does have to appear w...