mfc

Windows: obtain LDAP Organizational Unit

I have a User GUID. How could I get the Organizational Unit (OU) of this user? ...

Using a Qt-based DLL in a non-Qt application

Am I doing it right? A client of mine has a group where I'm developing Qt-based client-server stuff with a lot of fun widget stuff and sockets. Another group within the company wants to use a wrapped version of the QTcpSocket-based client data provider classes. (Which does basically what it sounds like, provides data from the server t...

How do I add MFC ActiveX control to an existing activex project.

In visual studio 2008 I can create an MFC activex project and it presents a wizard to create a single activex control. I now want to create new controls within this project. I can't find any way to do this. ...

Cwnd returnd Undefined Value

I want to use Setwindowpos() in global function to change the postiion of one dialog. So i coded like below CWnd *pWnd = (CWnd*)pMain->GetDlgItem(IDD_TOOLBAR_DIALOG);//GetActiveFrame (); pWnd->SetWindowPos(&CWnd::wndBottom,0,80,45,900,SWP_SHOWWINDOW); pWnd returns as undefined value. So i follow this method CToolTab * tab; tab = new ...

How to create controls at runtime?

How to create dynamic MFC controls and handle message maps of the controls at runtime? ...

Unable to copy data present in CMemFile using CMemFile::Detach()

I am writing two lines in memory using CMemFile::Write(): void CLISTCTRLDlg::Export(LPTSTR *pBlock) { CMemFile outMem(32768); CString csHeader = _T("EmpId EmpName EmpAddress\n"); outMem.Write(csHeader.GetBuffer(0), csHeader.GetLength()); CString csInfo = _T("1 TestName TestAddress\n"); outMem.Write(csInfo.GetBuffer(0), csInfo.Get...

Selection change event for MFC CListCtrl, caused by mouse/keyboard input only.

hi, i am using an mfc ListCtrl, is there anyway to know if a selection change was caused by mouse/keyboard input rather than a programatic change? i am after the same behaviour as ON_LBN_SELCHANGE for a listbox. thanks ...

Debugger ignores errors in dynamically loaded DLLs

Hello. I have a very strange problem related to debugging of self-coded DLLs. I have an MFC-driven dialog-based application, several projects linked statically and several DLL-projects which are loaded at runtime. I build solution in debug, run the application and I can easily debug those DLL-projects. Now the problem. If there is some...

Application wide periodic tasks with Dialog Based MFC application

In Single Document Interface (SDI) or Multiple Document Interface (MDI) MFC application, I created an application wide timer in the View. The timer will tick as long as the application is running and trigger some periodic actions. How can I do the same with Dialog Based MFC application? Should I create Thread's Timer (SetTimer with NU...

Why on earth does CEdit provide a copy/paste menu but CRichEditCtrl doesn't?

If you right-click in a standard MFC CEdit control you get a standard undo/cut/copy/paste/select-all context popup menu. But CRichEditCtrl doesn't provide the same thing as far as I can tell. Is there any good reason why it was left out? Such a pain having to write custom controls to add in 'standard' functionality! And how can it most...

OpenGL suppresses exceptions in MFC dialog-based application

Hello. I have an MFC-driven dialog-based application created with MSVS2005. Here is my problem step by step. I have button on my dialog and corresponding click-handler with code like this: int* i = 0; *i = 3; I'm running debug version of program and when I click on the button, Visual Studio catches focus and alerts "Access violation ...

After installing VS2008, I get a compile error in winnt.h

I'm trying to move our project over to VS2008 from VS2005 and am running in to this build error on an MFC project: C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winnt.h(236) : error C2146: syntax error : missing ';' before identifier 'PVOID64' I thought this was an SDK issue or an include directory ordering issue as some forum...

How do I force windows NOT to redraw anything in my dialog when the user is resizing my dialog?

When the user grabs a corner of a resizable window, and then moves it, windows first moves the contents of the window around, then issues a WM_SIZE to the window being resized. Thus, in a dialog where I want to control the movement of various child controls, and I want to eliminate flickering, the user first sees what windows OS thinks ...

How to simulate the failure of MFC based GUI functions in Unit Test?

How to simulate the failure of Dialog Box, Window Creation Functions and other MFC System Functions in a Unit Testing Environment? Are there any tools or frameworks available? ...

Not able to built my project in Release mode!please help me...

Hello friends,I am having a very diifult situation here...Actually I am developing a MFC project.In my project I have another small project inlcuded as a lib input to my main project.. I set the "use of MFC"--as "use MFC in Shared Dll" in my project settings...its working great..but when I set the "use of MFC" -- as "use MFC in static dl...

Can I force a parent window to redraw without causing its children to redraw?

Is it possible to invalidate a window without invalidating its children? (display invalidation to cause a repaint of the parent window, but not redraw its children) This assumes that the parent window already has the "clipchildren" style, so that its painting wouldn't inherently invalidate the children. ...

How to perform Zooming with CHtmlEditCtrl in MFC

Can anyone help me to perform zooming on CHtmlEditCtrl ? I displayed my html document on CHtmlEditCtrl. Now I want my edit control to display same html document with different zooming level. I saw this feature in InternetExplorer8. Now I need to add this zooming feature to my MFC application. ...

what is invalidate,update methods do in VC++

Hi all, i have small doubt regarding the window functions in c++. what exactly "invalidate()" function do? what message does it sends?when we need to call this? also what is "update()" function? is "invalidaterect()" works similar to "invalidate()" function?. Thanks ...

Problem displaying Icon in a button in windows xp(SP2) (MFC)!!

Hello friends,I had a problem in displaying icon in button along with the Text in MFC application.. after reading lot of arctilces I got a solution for that and it worked great.But when I tested my application in win xp(SP2)..it suprised me by not showing the icon..Check the below code which i used to display the icon along with a test i...

How do I display an MFC control in a windows forms application?

I'd like to create a windows forms control which shows an MFC control such as CIPAddressCtrl, with a working Text property and TextChanged event. How do I display an MFC control in a windows forms application? I'm happy to use C++/CLI if necessary. NOTE: I'm not asking how to create a brand new windows forms control; I want to host a ...