mfc

error using CArray

so, i am trying to use CArray like this : CArray<CPerson,CPerson&> allPersons; int i=0; for(int i=0;i<10;i++) { allPersons.SetAtGrow(i,CPerson(i)); i++; } but when compiling my program, i get this error : "error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' c:...

"error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject'

Possible Duplicate: error using CArray Duplicate : http://stackoverflow.com/questions/864864/error-using-carray so, i am trying to use CArray like this : CArray<CPerson,CPerson&> allPersons; int i=0; for(int i=0;i<10;i++) { allPersons.SetAtGrow(i,CPerson(i)); i++; } but when compiling my progra...

Get button focus - MFC

Hi, I have a VC++ MFC dialog application and in my OnTimer function I am just trying to determine which button in my dialog currently has focus. Here is some psuedocode of what I am trying to accomplish.... CDialog::OnTimer() { CButton *btn = GetButtonOnFocus(); int btnID = btn->GetDlgCtrlID(); } Any help would be great...

How can we vertically align text in edit box ?

I have created an editbox as: m_EditWnd.Create(m_hWnd, rect, NULL, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE, WS_EX_CLIENTEDGE | WS_EX_LEFT | WS_EX_LTRREADING); There is a style for horizontal alignment as ES_CENTER for horizontal text alignment, but can we a...

MSHTML IWebBrowser2 problem - Sinking page events causes missed keystrokes??

Hi all, I've got a bit of a problem with my application using MSHTML. I have everything working except for the odd keystroke missing behavior when typing fast as mentioned in the subject line. I think it may have to do with the method I use to sink the events? The details: my application is a separate program written in C++ and MFC in V...

WM_POWERBROADCAST message not caught in MFC Dlg

I try to catch WM_POWERBROADCAST message when the system goes into sleep mode. I'm doing like : BOOL CPowManApp::PreTranslateMessage(MSG* pMsg) { if(pMsg->message == WM_POWERBROADCAST || pMsg->message == WM_POWER) { CString strMessage; strMessage.Format(_T("%d WM_POWERB%s wParam %x lParam %x"), ...

Where can I find a feed Library for C++/MFC?

I am looking for a C++ feed library. Where can I find one? Edit: I need to be able to access feeds from my MFC application. I would like to have a library that can deal with RSS, audio, video, and whatever else it can fit. ...

What are Windows "USER objects"

I'm trying to track down an issue in our MFC code that looks like a resource limitation issue. Memory and CPU look fine. According to the processes tab on the Task manager our GDI objects look in line with other applications, but our USER objects appear to be a factor of 10 greater then other applications. What is a "USER object" and...

How can I see what is on the Desktop Heap

I have an application that is using about 100k more of the Desktop Heap in this version then it did last version. Is there a way I can see what is on the Desktop Heap and how big the individual objects are? Using Dheapmon I was able to see what percentage of the heap I was using, but I want more details. ...

Static control is not transparent +MFC

We have created a toolbar. there is a static control on toolbar and we have placed ab icon image over that static control. problem is that static control is having its own color and we are unable to make it transparent with respect to the browser theme color. so our icon appears to have some background color when browser themes are chan...

How to use CImageList

I want my tree view control to show an item with a folder icon next to it. so, i wrote this piece of code : HBITMAP hFolderBitmap = (HBITMAP)::LoadImage(AfxGetInstanceHandle(),_T("info.bmp"),IMAGE_BITMAP,20,20,LR_LOADFROMFILE|LR_CREATEDIBSECTION); if(hFolderBitmap) { cil.Create(20,20,ILC_COLOR32,0,5); bmp.FromHandle(hFolderBit...

List Control

Does anyone know where I can get MFC ListView Control just like the one that FeedDemon uses ? one which can be used to do grouping of items (FeedDemon). Thx. ...

SQLITE_DB[4] error (CppSQLite3DB)

I have a SQLite DB with one Table : Folder. when, i try to access it by running this query ("select * from Folder") against the DB, I get an error : SQLITE_DB[4] . I am using the CppSQLite3DB library ( www.codeproject.com/KB/database/CppSQLite.aspx ) . here is my code : #include "CppSQLite.h" try { CString sql; CppSQLite3Quer...

UDP Client - Release version not working in VS 2005 only

Hi, I have a simple UDP client/server program that that sends (server) a text string and receives (client) that text string to display on the dialog box. This is a MFC C++ program and I have it working properly in Visual Studio 6.0, Visual Studio 2003 in both the debug and release versions. I am trying to get the same code executing o...

CMenu and Dialog-based applications

Is it possible to put a menu in a dialog based application? How? ...

Create SQL queries for SQLite with MFC primitives

I'm using SQLite to store my program's state. sqlite3_exec() accepts the SQL query as a string. So I have a lot of code that builds such queries by concatenating numerous CString instances and a feeling that I'm doing something wrong. Is there a better way of doing this staying within primitives provided within SQLite and MFC? ...

MFC Dialog Based Application

I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing the application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code ...

Qt & double buffering - are there any neat tricks to capture pixels or manipulate the back buffer?

I'm migrating an application to Qt from MFC. The MFC app would use GDI calls to construct the window (a graph plot, basically). It would draw to a memory bitmap back buffer, and then BitBlt that to the screen. Qt, however, already does double buffering. When the user clicks and drags in the graph, I'd like that section of the window ...

trying to create a MFC dialog based application to read a video

Hi all, I'm writing a program using MFC Dialog based application to read a video. I'm using videolabs package as a reference. The error which I get when I compile the program is 1>c:\users\prashanth\documents\visual studio 2005\projects\videodemo34\videodemo34\videodemo34dlg.cpp(105) : error C2679: binary '=' : no operator found which ...

Regarind an Heap Size error

Hi all, When I'm running a program which is used to read an video I'm getting an error referring to Heapsize which is shown below: EAP[videodemo34.exe]: Invalid address specified to RtlSizeHeap( 04EC0000, 00254CE8 ) Windows has triggered a breakpoint in videodemo34.exe. This may be due to a corruption of the heap, and indicates a bug ...