Click here to Skip to main content
16,005,339 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString::GetBuffer [edited due to slight error] Pin
Abin8-Jul-02 16:54
Abin8-Jul-02 16:54 
GeneralRe: CString::GetBuffer [edited due to slight error] Pin
Rene De La Garza8-Jul-02 17:08
Rene De La Garza8-Jul-02 17:08 
GeneralRe: CString::GetBuffer [edited due to slight error] Pin
Christian Graus8-Jul-02 17:53
protectorChristian Graus8-Jul-02 17:53 
Generalusing delete() in recordset Pin
8-Jul-02 15:28
suss8-Jul-02 15:28 
GeneralRe: using delete() in recordset Pin
Carlos Antollini8-Jul-02 20:12
Carlos Antollini8-Jul-02 20:12 
GeneralRECOVERING A BINARY TREE FROM ITS POST-ORDER CODE!! Pin
barking_dogs8-Jul-02 14:35
barking_dogs8-Jul-02 14:35 
GeneralRe: RECOVERING A BINARY TREE FROM ITS POST-ORDER CODE!! Pin
Christian Graus8-Jul-02 16:56
protectorChristian Graus8-Jul-02 16:56 
QuestionCalling a parent method? Pin
clintsinger8-Jul-02 14:07
clintsinger8-Jul-02 14:07 
I am using WTL (please don't run away yet) and I have a derived class that from the ListView control. The listview control has a Method called AddItem which adds a row to itself.

If I create a variable that derives from my custom control I can access AddItem just like any other public member in a class. But when I try to put AddItem inside another method to enhance my custom control it gives me this error:

error C2662: 'AddItem' : cannot convert 'this' pointer from 'const class CSimpleGrid' to 'class WTL::CListViewCtrlT<class ATL::CWindow> &'


and this is my method:
class CSimpleGrid : public CWindowImpl <CSimpleGrid, CListViewCtrl>, CCustomDraw<CSimpleGrid>

...

BOOL AddRow(CString strRow) const
{
  INT nCurCol = 0;
  INT nCurRow = GetItemCount();
  INT nStrLen = strRow.GetLength();
  INT nPos = strRow.Find("\t");

  if (strRow.IsEmpty())
  {
    return FALSE;
  }

  if (nPos == -1)
  {
    // Add the whole item to the first column.
    AddItem(0, nCurRow, LPCTSTR(strRow));  <- Fails on these AddItems
    return TRUE;	
  }

  while (nPos < nStrLen)
  {
    INT nPosEnd = strRow.Find("\t", nPos);
    AddItem(nCurRow, nCurCol, LPCTSTR(strRow.Mid(nPos, nPosEnd - nPos))); <- This one too.
  }
  return TRUE;
}


I haven't actually tested the logic in this one so it is possible that the algorithm is incorrect but as I can't even compile that is the least of my worries.


Cheers,
Clint
AnswerRe: Calling a parent method? Pin
Chris Losinger8-Jul-02 14:17
professionalChris Losinger8-Jul-02 14:17 
GeneralRe: Calling a parent method? Pin
clintsinger8-Jul-02 15:19
clintsinger8-Jul-02 15:19 
GeneralMouse Messages Pin
carp8-Jul-02 13:47
carp8-Jul-02 13:47 
GeneralRe: Mouse Messages Pin
Christian Graus8-Jul-02 16:57
protectorChristian Graus8-Jul-02 16:57 
GeneralRe: Mouse Messages Pin
carp10-Jul-02 5:55
carp10-Jul-02 5:55 
GeneralRe: Mouse Messages Pin
Christian Graus10-Jul-02 12:29
protectorChristian Graus10-Jul-02 12:29 
GeneralVariable Number of Arguments Pin
8-Jul-02 13:03
suss8-Jul-02 13:03 
GeneralRe: Variable Number of Arguments Pin
8-Jul-02 13:07
suss8-Jul-02 13:07 
GeneralRe: Variable Number of Arguments Pin
Chris Losinger8-Jul-02 14:18
professionalChris Losinger8-Jul-02 14:18 
GeneralRe: Variable Number of Arguments Pin
8-Jul-02 16:07
suss8-Jul-02 16:07 
Questionpragma warning disable? Pin
User 66588-Jul-02 11:06
User 66588-Jul-02 11:06 
AnswerRe: pragma warning disable? Pin
Stuart Dootson8-Jul-02 12:42
professionalStuart Dootson8-Jul-02 12:42 
AnswerRe: pragma warning disable? Pin
Michael Dunn8-Jul-02 16:53
sitebuilderMichael Dunn8-Jul-02 16:53 
GeneralRe: pragma warning disable? Pin
User 66589-Jul-02 0:03
User 66589-Jul-02 0:03 
Questionmalloc/new vs GlobalAlloc strategy ? Pin
yarp8-Jul-02 9:59
yarp8-Jul-02 9:59 
AnswerRe: malloc/new vs GlobalAlloc strategy ? Pin
Tim Smith8-Jul-02 10:10
Tim Smith8-Jul-02 10:10 
GeneralRe: malloc/new vs GlobalAlloc strategy ? Pin
yarp8-Jul-02 18:52
yarp8-Jul-02 18:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.