mfc

Change appearance of window control

Hi, I want to change appearance of all common controls in my application. can I do it programmatically with an easy way. I have huge code base and I don't want to modify each and every resources. I prefer if I can inject DLL which change default look of windows common controls, which I fuse into window system while starting application...

How To Prepare An ActiveX Control For Delivery Over The Web

So i have the misfortune of embedding this proprietary ActiveX control we created into a web page so that it downloads the code from our server and installs as necessary. Our ActiveX requires a host of other files which need to be installed along with the activex control itself. It should also be noted that the activex and all its de...

IHTMLDocument2Ptr giving compilation error.

Hi, I am trying to compile one of old project in Visual Studio 2003 on Vista. This project is compiling like a charm on other machine even with Vista(and also with XP) but on my machine. I've checked all settings and include paths but all seems correct. One thing I observed unique on my machine is when I try to find reference of IHTMLD...

Is there a way to create a view in a CSplitterWnd without using (MFC) dynamic object creation?

Hi, I was previously using a CSplitterWnd in a MFC application, using it's CreateView function. Everything was working fine but now I would like to pass a parameter to the constructor of my views, so I cannot use MFC dynamic object creation (DECLARE_DYNCREATE and IMPLEMENT_DYNCREATE) because they require an empty constructor. After sear...

Best method for requeing functions

Hello, We have a windows service in C++/ MFC which has to carry out a number of tasks on the host workstation some of which may be long running and may fail a few times before they are completed. Each task will only need to be completed once and sequentially. I was of thinking of some form of callback initially to retry the failed ...

What is the lifetime of a CWnd obtained from CWnd::FromHandle?

According to msdn, when I get a CWnd* with CWnd::FromHandle, The pointer may be temporary and should not be stored for later use. What is meant by "later use" is not clear to me. Is it only the scope of the current method? As far as I know, there is no GC in Win32! ...

How to handle CEdit mouse click in parent form?

I'm new to MFC (coming from C# and Java) and figuring things out. Consider a dialog with three text boxes. I have subclassed CEdit to CMyEdit, and the three text boxes are hooked up to CMyEdit variables in the dialog class. I want to allow the dialog class to "know" when any of the three text boxes has been clicked with the left mouse ...

CWinAppEx undefined class

Hey, I created a dialog base application using the wizard in VS C++ 2008. Haven't added any code my self. When I compile I get a few errors saying that CWinAppEx is undefined. c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.h(19) : error C2504: 'CWinAppEx' : base class undefined c...

List box context menu

How do I add a context menu in a list box in MFC? I don't see any WM_CONTEXTMENU handler in list box's properties. Any ideas? EDIT: I followed this tutorial MFC List Control: How to use a context menu in a list control?. The tutorial says to derive my own class from CListBox which I did, but now how do I add list box of my derived class...

Link error CString

I'm getting a linker error using CString the error is: error LNK2001: unresolved external symbol "private: static class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > CConfiguration::_campaignFolderPath" (?_campaignFolderPath@CConfiguration@@0V?$CStringT@_WV?$StrTraitMFC@_WV?$ChTraitsCRT@_W@ATL@@@@@A...

How to stop MFC from disabling my controls if I don't declare a message map entry for it's corresponding command?

Hi, I have the following problem: MFC is disabling my toolbar (a CToolbar) controls if I don't have a message map entry for it's corresponding message (let's say ID_MYBUTTON1). Is there a way around this? I had the same problems with the menu but I found that you could disable the auto disabling by setting CFrameWnd::m_bAutoMenuEnable t...

MFC Get Folders

Hey how do I in MFC get names of all folders? Any examples or which classes should I look into? Any hints will be really appreciated. All I saw is the CFile, which as far as I have seen (though very very little) doesn't looks like it has the ability to do what I want. So please direct me. Thanks ...

Getting out of memory exception when loading high resolution image with IImagingFactory

I am trying to load high resolution image(like 3264x2448). For that I am using IImageFactory class in C#. IImageFactory is downloaded from the Microsoft site. If I try to load the high resolution image I am getting “out of memory” exception. Have a look at the below sample: IImage GetIImage(string fileName) { Bitmap bitmap = null; Gra...

Constructing a C++ object (the MFC CRecordset) thread-safely

We're trying to build a class that provides the MFC CRecordset (or, really, the CODBCRecordset class) thread safety. Everything actually seem to work out pretty well for the various functions like opening and moving through the recordset (we enclose these calls with critical sections), however, one problem remains, a problem that seems t...

How to get CEdit to scroll properly?

I have a CEdit control that's used to display a diagnostics output. Sometimes the data overflows the screen size, so naturally I set the Vertical Scroll property to true (MFC dialog editor). But then, when I tried to scroll the text that was in the window before isn't cleared and the new text is written over it. The result is a big m...

how to get handle of Internet explorer and get the textboxes value in VC++

Hi all.. I have a doubt regarding Internet explorer handling in VC++. I need to get the URL entered in address bar of Internet Explorer and the value of textboxes in the webpage. How is it possible? and how can i get them? I'm using FindWindow() to do this, but unable to get around this. Specifically in MFC. Any sort of help is grea...

List Control SetFocus Redraw Error on a Tab Control

Environment: Visual Studio 2008, Visual Studio Feature Pack, MFC Dialog App, Windows XP, New Common Controls. I'm having a problem with a list control that happens to be on a tab control. To reproduce the problem simply create a dialog based app. Place a tab control on that dialog, then put a list control onto that tab control. You d...

Get the Process ID by its name in win32 windows mobile

Hi, how to get the process ID and handle of a process by its name in win32(windows-mobile). i mean if i pass the process name i should get id.. how to do this.. Thanks in advance. ...

How do you prevent a user from resizing the column width of a clistctrl (report view)?

How do you prevent a user from resizing the column width of a clistctrl (report view)? ...

How to get rid of C4800 warning produced by boost::flyweight in VS2008

Hi, I get a warning when compiling below code in VS2008 with MFC turned on. Boost version 1.39 include "boost/flyweight.hpp" include "boost/flyweight/key_value.hpp" class Foo { public: Foo(const CString} private: const CString mfoo; }; struct Conversion { const CString} }; using namespace boost::flyweights; flyweight<...